2

I want to retrieve DOM object in javascript with updated values.

I have used following code.

<script>
     $(document).ready(function(){
    $("#btnTest").click(function () {
        alert($("html").html());
                /*further processing with retrieved DOM */
    });
     });
   </script>

and body have :

<body id="p">
    <form method="post" name="frmData">
        <input type="hidden" name="data" id="data"/>
        "Enter text :" <input type=text id="testData" name="testData" title="Enter Text" value=""/> <br/>
        <input type=checkbox name="chkRed" value="Red" id="chkOne" title="Red"/>Red
        <input type=checkbox name="chkYellow" value="Yellow" id="chkOne" title="Yellow"/>Yellow
        <input type=checkbox name="chkGreen" value="Green" id="chkOne" title="Green"/>Green
        <input type="button" name="btnTest" id="btnTest" value="Test"/>
    </form>
</body>

now what i want is

When i click on "Test" button i want to get whole DOM in javscript variable with user inputed values.

The above function retrieves whole DOM but it does not update the DOM with user inputs.

What i need to change if i want updated DOM?

Romani
  • 3,241
  • 4
  • 25
  • 28

1 Answers1

0

this could be helpful - DOM update

Community
  • 1
  • 1
Igor Milla
  • 2,767
  • 4
  • 36
  • 44