Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> Search: <input type="search" id="mySearch"> <p>Click the button to set the maximum number of characters allowed in the search field.</p> <p id="demo"></p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { document.getElementById("mySearch").maxLength = "8"; document.getElementById("demo").innerHTML = "Maximum number of characters allowed in the search field is now 8."; } </script> </body> </html>