HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <input type="text" value="Change Me"> <p>Click on the button to toggle attribute between editable and readonly</p> <button onclick="myFunction()">Toggle Button</button> <script> var elem = document.getElementsByTagName("input")[0]; function myFunction(){ elem.toggleAttribute("readonly"); } </script> </body> </html>
OUTPUT
×

Save as Private