- select visually (color, size, border, ...) or select text as ctrl + a? - Specter
|
1 answer
$( function(){ $('input').click( function(){ $(this).select() }) })
- oneinstead of $ (this) .select () it’s better to use this.select () to save on the face. - lampa
- oneAbout yes XD ... - Yakovlev Andrei
- the most economical option (if only one form is used) <input onclick = "this.select ()"> -
- 3tests: jsperf.com/selecttest123/3 As you can see, the difference between $ (this) and this is minimal. And option @ Ь_ zhzhot =) - Yakovlev Andrey
- @Andrey Yakovlev, anyway, for every click, a jQuery object is created. - lampa
|