javascript - Does html() really replace html code? -


i have html code this,

<form action="abc.html" method="post">    <div id = "result">       <input type="hidden" value="1" name="banner">    </div> </form> 

then jquery code replace content in div,

var temp = "<input type='hidden' value='1' name='banner'>" $(".result").html(temp); 

then submit form , find there 2 values in form.banner, form.banner=1,1

do wrong? or have use clear data first use html()? lot!

replace .result #result. you're trying target class, div contains id.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -