HTML Input - Getting The Value Via InnerHTML Or XMLSerializer
I have an input box on a html page. I know I can get just the value, but I want the entire input string, i.e. , but with the value present: Copy
<input id="myInput" value="my entry that I just typed in"/>
myVar = document.getElementById("myInput").outerHTML;
if(myVar.charAt(myVar.length - 1) !== "/"){
console.log(myVar.slice(0, myVar.length-1) + "/>");
}
<input id="myInput" value="my entry that I just typed in"/>
Post a Comment for "HTML Input - Getting The Value Via InnerHTML Or XMLSerializer"