I have a web page and I want to do something with user input text. Normally, <input type="text" /> is used inside a <form> nesting and setting input without form attribute is not acceptable in html strict schema. I want to avoid <form>, but still want some text field to use with JavaScript.
I am seeking an example with an option for text input and alert input data on click of a button, with/without jQuery.
Using W3C’s validator, this passes HTML 4.01 Strict:
and this passes XHTML 1.0 Strict:
The problem is that
<input>is an inline tag and thus needs to be inside something that accepts such tags (<body>does not).