Skip to content Skip to sidebar Skip to footer

Get Html Source With Values Attributes Set For Input

I'm using jQuery to send an HTML document which contains a form to a C# WebService. The webService parse it and try to read 'value' attribute of all inputs in the form. The problem

Solution 1:

you can try it

HTML

<inputtype="text" name="foo"id="foo" />

in Jquery :

var foo = $("#foo").val();
alert("Jquery foo value : " + foo);

in JavaScript :

var foo = document.foo.value;
alert("JavaScript foo value : " + foo);

Solution 2:

Try

document.getElementById('foo').outerHTML

Post a Comment for "Get Html Source With Values Attributes Set For Input"