Split text with jQuery

/ Published in: jQuery
Save to your folder(s)

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

Copy this code and paste it in your HTML
  1. function getID(value) {
  2. returnvalue = value.split(/;#/)[0];
  3. return returnvalue;
  4. }
  5. var text = '1;#Athene';
  6. var abc = getID(text);
  7. console.log(abc);

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.