php - How with javascript change html code -


i need following change using javascript: from:

<input id="innn" value="" /> 

to:

<input id="innn" value="some_value" /> 

i tried this:

document.getelementbyid("innn").setattribute("value", "189"); 

and this:

document.getelementbyid('innn').value = '152'; 

it worked changed visual on page not html code , need change code shown below:

<input id="innn" value="" /> --> <input id="innn" value="125" /> --><input id="innn" value="158" /> 

please or must use php : <input id="innn" value="<? php ... ?>" /> ????

html rendered in order browser know show on page. once sent server not change (at least not basic javascript). there more advanced ways of doing things, not simple. when call javascript function change something, changes in dom, see change on screen, when click view-source browser fetching original page again server show you. in browsers have called inspect mode allows see html looks right page. in case show updated code. if want when clicks view-source , sees some_value in value id="innn", need use php.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -