[英]<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.