Make HTML hidden input visible

前端 未结 3 1066
萌比男神i
萌比男神i 2021-01-12 15:04

I want to change an invisible HTML input in to visible when I click a button as shown below.

My HTML line that create the hidden input is:



        
3条回答
  •  执念已碎
    2021-01-12 15:44

    You should change the type of input element as :

     y.setAttribute('type','text'); 
     //or
     y.type = 'text';
    

    1) Either user java script inside body tag as below :

    
    
    
    

    OR

    2) Use some event handler such as onload

    
    
    
    
    
    
    
    
    ...
    

    so that the DOM is ready.

提交回复
热议问题