王多静

这里是我的记事本

导航

遇到容易忘记的问题(三)

遇到容易忘记的问题(二)

11. js获取name

 <lable>
    <span id="onlinePerson" name="person" onclick="changeImg(this)" >
      <img id="imgPerson" src="images/invote-checked.png">个人
   </span>
 </lable>
function changeImg(obj) {
    // console.log(obj.name); //错误的只支持obj.id
    // $(obj).attr("name"); //jquery写法
    console.log(obj.getAttribute("name"));
}

 

12.webstorm多个项目同时显示,原来经常会用得到,但是总是忘记,今天就在这备忘了。再也不用担心遇到在哪里打开“this window” 或者“new window”:

File -> settings -> Directories -> Add Content Root 添加新项目->确定即可。

  

 13.多行文本框(文本域)编辑需要高度自适应, 改变不了<textarea>的样式, 只能用<div>模仿了, 使用contenteditable 属性,来规定元素内容是否可编辑。

<div class="liketextarea" contenteditable="true" ></div>
.liketextarea{
    width: 100%;
    min-height: 1.6rem;
    border: none;
    background: transparent;
    outline: none;
    font-size: .26rem;
    color: #1c1c1c;
    line-height: .44rem;
}

 

posted on 2019-02-18 17:59  王多静  阅读(186)  评论(0编辑  收藏  举报