how can i get only the cheque number(AA12GH56) not the other texts, here is my code:
HTML:
<p>your cheque number is :AA12GH56 <br /> your bank credit balance is :32,999</p>
Javascript:
$(document).ready(function(){
$('p').click(function(){
var cheque_no=$(this).text();
});
});
Either a regular expression or a precision
.splitis what you need. I’m a fan of the latter technique — what it loses in brevity it makes up in clarity.http://jsfiddle.net/mblase75/c6Zms/