开发者

retrieve DOM object in javascript with updated values

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?


this could be helpful - DOM update

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜