I am new to jquery and am having problems with what, in my opinion, should be a very simple search and replace operation.
I want to change the text inside the "<p>" tags. So, for example, I could replace "your title" with "title".
<div id="ValidationSummary"> <ul> <li> <p> Please specify your title</p> </li> <li> <p> Please enter your first name</p> </li> <li> <p> Please enter your surname</p> </li> </ul> </div>
and here is jQuery that does nothing:
$(function() { $('#ValidationSummary').text().replace("your title", "a title"); $('#ValidationSummary').text().replace("first name", "christian name"); $('#ValidationSummary').text().replace("your surname", "your last name"); };
I really donβt see what I'm doing wrong, any ideas?
Please help thanks
source share