[英]<textarea onclick=“this.value; this.select();”> ? What kind of trick is this?
[英]Chrome Crashing with whitespaces in Textarea on using onClick=“this.select();”
我使用铬版38.0.2125.104(64位)。 这在this.select()的Textarea中出现空格崩溃。
<style>
.custom-input {
font-size: 12px;
width: 100%;
color: #555555;
}
.parent-div {
white-space: nowrap;
}
.child-div textarea {
white-space: inherit;
}
</style>
<div class="parent-div">
<div class="child-div">
<textarea class="md-input ng-binding" type="text" readonly="" onclick="this.select();" rows="4"> <img src="http://www.nikhilmaheshwari.in"
alt="ITs my homepage, see http://www.nikhilmaheshwari.in" height="1" width="1" />
</textarea>
</div>
</div>
检查JS小提琴http://jsfiddle.net/nikdtu/vqfefjwo/
我知道一些解决方法,但我有兴趣了解其原因。 请提出您是否可以分享可能的原因。
编辑:其工作与“空白:前行;” 或“空白:前置;” 或“空白:预包装;” 但不能使用“空白:nowrap;” 或“空白:正常;” 或“空白:继承;”(如果父级是正常或nowrap中的任何一个)
从textarea
标签中删除内部空间
<textarea class="custom-input ng-binding" type="text" readonly="" onclick="this.select()" rows="4"><img src="http://www.nikhilmaheshwari.in" alt="Its my homepage !, see preview @ http://www.nikhilmaheshwari.in" height="1" width="1" /></textarea>
它对我来说很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.