HTML and CSS Reference
In-Depth Information
StorageMaster=new Object();
//Set values
StorageMaster.setRegistration=function()
{
this.hobbyNow=““;
this.topCount=document.interest.elements.length;
for(var count=0;count < this.topCount;count++)
{
if(document.interest.elements[count].checked)
{
this.hobbyNow=document.interest.hobby[count-1].value;
}
}
localStorage.setItem(“uName”,document.interest.userName.value);
localStorage.setItem(“uHobby”,this.hobbyNow);
localStorage.setItem(“uState”,document.interest.resState.value);
}
//Get values
StorageMaster.getReg=function()
{
userProfile=“User Profile:\n”;
nameNow=localStorage.getItem(“uName”)+”\n”;
hobbyNow=localStorage.getItem(“uHobby”)+”\n”;
stateNow=localStorage.getItem(“uState”)+”\n”;
fileLength=localStorage.length + “ profile items”;
this.profile=userProfile+nameNow+hobbyNow+stateNow+fileLength;
document.getElementById(“profile”).innerHTML = this.profile;
}
StorageMaster.clearReg=function()
{
localStorage.clear();
alert(“Local storage cleared”);
}
</script>
<style type= “text/css” >
/*962D3E,343642,979C9C,F2EBC7,348899 */
body {
background-color:#F2EBC7;
color:#962D3E;
font-family:Verdana, Geneva, sans-serif;
}
h2 {
color:#979C9C;
}
fieldset {
color:#348899;
}
#hobbyTable {
display:table;
}
#getHobby {
317
 
Search WWH ::




Custom Search