Hi friends trying to add an input box by clicking on button and also applying onfocus and onblur functions on newly created input box for you reff plz see this link http://jsfiddle.net/2TDZA/ and also check my code mentioned below. The main problem is when i add an input the script which will be use while onfocus and onblur are stop working please help me guys
Thanks in advance.. :)
HTML
<table width="278" border="0" align="left" cellpadding="0" cellspacing="0" id="emailTable">
<tr>
<td width="207" align="left"><input name="" value="Enter Friend’s mobile no" type="text" onfocus="if(this.value == 'Enter Friend’s mobile no') {this.value=''}" onblur="if(this.value == ''){this.value ='Enter Friend’s mobile no'}" placeholder="Enter Friend’s mobile no" autocomplete="off"/></td>
<td width="71" align="right" valign="top"><div class="addRow">Add</div></td>
</tr>
</table>
SCRIPT
$('.addRow').click(function () {
$('#emailTable').append("<tr><td align='right'><input name='' value=\"Enter Friend’s mobile no\" type='text' onfocus='if(this.value == \"Enter Friend’s mobile no\") {this.value= ''}' onblur='if(this.value == ''){this.value =\"Enter Friend’s mobile no\"}' placeholder=\"Enter Friend’s mobile no\" autocomplete='off'/></td><td class='delRow'> X</td></tr>")
})
$(document).on("click", '.delRow', function (event) {
$(this).parent('tr').remove();
});
on