Split text with jQuery

2014-09-21 • Plugins • Views: 1672

Split text with jQuery

Simple splitting of a string, just change [0] to [1] if you want to get the text after the “;#” you can change that too


function getID(value) {
returnvalue = value.split(/;#/)[0];
return returnvalue;
var text = ‘1;#Athene';
var abc = getID(text);


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>