innerHTML works in Firefox but not in Chrome

javascript, jquery

Solution

for input field use value not html to get their value

IN JAVASCRIPT

SET

document.getElementById("mappingIDinput").value="abc";

GET

alert(document.getElementById("mappingIDinput").value);

in jQuery

SET

$("#mappingIDinput").val("abc");

GET

 alert($("#mappingIDinput").val());

Problem

If we execute below code in Firefox 23, both alert boxes show correct value. When I execute the same in Chrome 28, second alert shows blank window. HTML ``` <input type="hidden" id="mappingIDinput"/> ``` JS ``` alert(mappingId); document.getElementById("mappingIDinput").innerHTML=mappingId; alert(document.getElementById("mappingIDinput").innerHTML); ``` How can I save & retrieve value in hidden input field which works across browsers(ignore IE if required).

Original source