php - change textbox value with javascript codeigniter -
my view javascript :
<html> <head> <script type="text/javascript"> document.getelementbyid("asd").value = 'sdasdsad'; </script> </head> <body> $atta = array( 'id' => 'asd' ); echo form_input($atta); </body> </html>
the result is, textbox empty. happened?
your did not enclosed php scripts php tags.
why not try this.
<html> <head> <script type="text/javascript"> window.onload=function() { document.getelementbyid("asd").value = 'sdasdsad'; } </script> </head> <body> <input type="text" id="asd" > </body> </html>
Comments
Post a Comment