首页 > 其他 > 详细

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

时间:2019-02-18 18:08:23      阅读:281      评论:0      收藏:0      [点我收藏+]
遇到容易忘记的问题(二)

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新建多个项目: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;
}

 

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

原文:https://www.cnblogs.com/wangduojing/p/10397020.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!