I'm having one page, choosemerchant where I get the list of merchants. After selecting a list item I want to append that list item value to the textbox id which belongs to a different html page. Here is my code:
$('.ui-li-icon li').click(function() {
var index = $(this).index();
text = $(this).text();
alert('Index is: ' + index + ' and text is ' + text);
sessionStorage.setItem("selectedMerchant", text);
window.location="recommendmanual.html";
$('#merchant').append(text);
});
And in my page which contains textbox id=merchant I have put this code in script:
var selectedMerchant = "";
if ( sessionStorage.getItem("selectedMerchant") ) {
selectedMerchant = sessionStorage.getItem("selectedMerchant");
}
It worked before, but now it's not working.
#merchantis in next page, but how youappendinclickof first page ? doesn't this comes in next set of code you mentioned ?