Lots of errors:
Code:
if(typeof(Storage)!=="undefined")
should be
Code:
if(typeof(localStorage)!=="undefined")
- - - - -
Code:
localStorage.edit=getElementById("edit");
you cannot use getElementById() alone.
it must be
Code:
element.getElementById("edit");
where
element. most likely should be
document.
and you are probably trying to use the innerHTML of #edit
so
Code:
localStorage.edit=document.getElementById("edit").innerHTML;
- - - - -
Code:
$edit.blur(function(
is wrong,unless you have assigned an element to $edit, e.g:
Code:
$edit=document.getElementById("edit")
I guess you are trying to use jQuery's equvalent of document.getElementById(), then it must be
and you are also trying to set the function as a parameter of the blur function
Use:
Code:
$("#edit').blur()=function(){
- - - - -
you save the data as
localStorage.edit but tries to read it as
localStorage.Edit
Javascript is case-sensitive, which means that they are not equal.
- - - - -
and you are storing the item
toDoData by
Code:
localStorage.setItem( 'toDoData' , this.innerHTML));
but you do not use this data afterwards.
- - - - -
I guess that you are looking for this:
Code:
<script>
if(typeof(localStorage)!=="undefined")
{ localStorage.edit=document.getElementById("edit").innerHTML;
$("#edit').blur()=function(){
document.getElementById("edit").innerHTML=("Test of : " + localStorage.edit);
}
}
</script>