Html-Css-Js
Title | Summary |
---|---|
取得Textarea游標位置 javascript textarea |
透過JS可取得textarea的selectionStart和selectionEnd屬性 function(textareaId) { var ta = document.getElementById(textareaClientId); return ta.selectionStart; } 參考 https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Property/selectionStart |
文字截斷 css text truncate |
單行: .text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } https://codepen.io/PJCHENder/pen/QOgVLR 多行: https://css-tricks.com/line-clampin/ https://codepen.io/nxworld/pen/wxZPwL |