javascript - getting value from one html page and appending it to the textbox id of the next html page -
I had asked this question before but my problem still has not been solved. Let me explain my problem again. Choose the HTML page with default button, select the merchant, select the product, select the product.in, select a merchant, I have a text box, which he has ID = merchant. After this, clicking on the trader who chooses to go to brand.html and give me a list of merchants. After climbing one of the list items, I am getting the value of this merchant in variable text and now wants to add this value to the Recommend HTML textbox. This is the code that I tried but was not working .. The brand is JS
$ ('.i-li-icon li'). Click (function () {var index = $ (this) .index (); var text = $ (this) text (); warning (index is: '+ index +' and 'text' is text); sessionStorage. SetItem ("Selected Merchant", text); window.place = "Recommended" # $ ('# merchant') .append (text);}); This is recommend.js
function load () {var selectedMerchant = ""; If (sessionStorage.getItem ("Selected Merchants")) {selectedMerchant = sessionStorage.getItem ("selectedMerchant"); Warning (selectedMerchant); }} and recommend.html
& lt; Input type = "text" id = "merchant" & gt; & Lt; / Input & gt;
You must set the value of #merchant your recommendation. js function load () {var selectedMerchant = ""; If (sessionStorage.getItem ("Selected Merchants")) {selectedMerchant = sessionStorage.getItem ("selectedMerchant"); $ ("# Merchant") val (selectedMerchant). }}
Comments
Post a Comment