W3C validation error with <input> inside <script>
I have the follow code:
<script type="text/javascript"> jQuery(document).ready(function() { jQuery('#selectone').change(function() { if(jQuery('#selectone option:selected').text() == 'General'){ jQuery("form[id=search]").attr('action', '/portal/search'); jQuery('form[id=search]').attr('id', 'cse-search-box1'); jQuery("#hiding").html("<input type='hidden' name='cof' value='FORID:11' />"); }else{ jQuery('form[id=search]').attr('action', '/portal/business/search'); jQuery('form[id=search]').attr('id', 'search'); jQuery("#hiding").html(""); } }); }); </script>
<form action="/portal/business/search" id="search" name="search" method="get">
<div id="hiding"></div>
<input id="q" name="q" type="text" />
<select id="selectone"> <option>General</option>
<option selected="selected">Business</option>
</select>
<input name="sa" id="sbb" type="submit" alt="Search" /> </form>
but, W3C says:
Line 150, Column 154:
document type does not allow element "input" here
because I am using input inside of <script> and it's wrong.
How can I solve this problem? Does anyone have any sugestion?
Thanks.