i using jquery mobile .i value drop down ,and save value in local storage .but after reload or refersh not set value. here fiddle. http://jsfiddle.net/ravi1989/pjkyw/
$(document).on('change', '#select-choice-1', function() { var fontfamily = $(this).val() ; alert(fontfamily) window.localstorage.setitem("fontfamily", fontfamily); }); var fontfamily= window.localstorage.getitem("fontfamily"); alert(fontfamily); if(fontfamily!=''){ alert("text") $('.fontfamily_h').val(fontfamily); }
please click first button on header (setting button).it show font family .the value of font family not set after refresh
use id of drop down selector instead of class ".fontfamily_h
"
$('#select-choice-1').val(fontfamily).selectmenu("refresh");
this works!!!
Comments
Post a Comment