php - Hide and Show TextBox in Javascript -


i trying hide , show box using following code. work box displayed default. can hide box , display on click? onclick works hide box.

<script type="text/javascript"> function display(id) { var obj = document.getelementbyid(id) if (obj.style.display == "none") { obj.style.display = "block"     } else {     obj.style.display = "none"     } return false } </script>   <form> <input type="button" value="customize" onclick="display('box1_<?=$pd_id?>')"> <input type="submit"> </form> 

addthe following either in stylesheet or inline styling

style="display: none;" 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -