V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
qiu0130
V2EX  ›  前端开发

CoffeeScript 怎么给<input class="input1"/> 添加属性

  •  
  •   qiu0130 · 2016-10-17 20:58:54 +08:00 · 1809 次点击
    这是一个创建于 2763 天前的主题,其中的信息可能已经有所发展或是发生改变。

    例如:

    <input class="input1">

    添加 type="text"

    改怎么做?

    不懂前端,没接触过的 CoffeeScript.

    4 条回复    2016-10-18 09:34:08 +08:00
    zythum
        1
    zythum  
       2016-10-17 21:25:25 +08:00   ❤️ 1
    ```
    document.querySelector '.input1'
    .setAttribute 'type', 'text'
    ```

    话说啥都不会呢。就别用 coffee 这种东西了,好好写 js 去。
    aliuwr
        2
    aliuwr  
       2016-10-17 21:31:17 +08:00
    @zythum 朱一姐姐还是这么不辞辛苦,乐于助人
    qiu0130
        3
    qiu0130  
    OP
       2016-10-18 09:26:33 +08:00
    @zythum 真是啥也不会呀, 需要的开源组件是 coffee 写的, 我入坑了。
    BTW, 我是写 python 的,
    qiu0130
        4
    qiu0130  
    OP
       2016-10-18 09:34:08 +08:00
    @aliuwr 姐姐一定很漂亮。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1225 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:41 · PVG 07:41 · LAX 16:41 · JFK 19:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.