ID new のボタンを使用してクリアしている単純なフォームがありますが、データを更新したいボタンは、新しい作成ボタンとしても機能します。
これはボタンhttp://jsfiddle.net/tde8Q/6/です
これがコードです
$("#new").click(function(){
$('#id').val("");
$('#firstname').val("");
$('#lastname').val("");
$('#city').val("");
$('#continent').val("");
$("#neworupdate").prop('value', 'Save New').attr('id', 'createnew');
});
$("#createnew").click(function(){
alert('this worked');
});
createnew ID はどのように使用しますか?