Skip to content
Advertisement

Click button to select text in input is not working

text is not selected in js tried all methods in. select() and btn.select() in not selecting the text in textbox

JavaScript
JavaScript

Advertisement

Answer

in is a reserved key in javascript so cant use it and you have to remove () after the onclick when you want to assign it to value.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement