I've got a table column definition that looks like this:
<td class="dvRequiredField validationFailed">
*
<input name="ctl00$MainContent$dvCustomer$ctl04" type="text" title="First Name" class="validationFailed">
Required Field.
</td>
How do remove the "asterisk" (or in a sense replace it with '') using jquery?
I've tried the following:
$('td.validationFailed').each(function () {
$(this)[0].innerHTML = $(this)[0].innerHTML.replace(/\*/g, '');
});
It does not work. It replaces/removes the text value of my input control.
Thanks, JohnB
$('td.validationFailed').contents().filter(function() {
return this.nodeType == 3 && this.wholeText.indexOf('*') > -1;
})
.remove();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.