Saturday, 15 June 2013

HTML5 insert data to input field -


Must be stored in the storage and this data must be entered in the appropriate input files ... but I can not find the data in the input field .. I give my code below .. if any error pls help .. ..

  & lt; Body onload = "onLoad ();" & Gt; & Lt; Div class = "app" & gt; & Lt; Form & gt; * First name: & lt; Br> & Lt; Input type = "text" style = "width: 80%;" Id = "FN" input name = "first" maximum length = "15" & gt; & Lt; Br> & Lt; / Form & gt; & Lt; / Div & gt; & Lt; Script language = "javascript" & gt; Function onload () (if (localStorage.getItem ('name1') == "Roy") {document.getElementById ("fn"). Value = localStorage.getItem ('fnm');}} & lt; / script & Gt;    

JSON methods

Setting value:
localStorage.getItem ('key', JSON.stringify ('VALUE'))

Obtaining the value:
JSON.parse (LocalStorage.getItem ('FNM'))


No comments:

Post a Comment