Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
var item='<input class="item" type="text" value="1"/>'; $('#div1').replaceWith(item); var val1 = $('.item').val();
これは未定義を返します。DOM要素の置き換えと関係があると思いますが、これを修正する方法がわかりません。
私のために働くようです:
http://jsfiddle.net/YMBeX/
コードのどこかに問題があると思われます。