How can I check a string is a class or an ID then strip them off to get the name? For instance,
$string = ".isclass";
$string = "#isid";
if($($string).indexOf('.') != -1)) alert($($string).substring(1));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to know if the string starts with a
.or#and then use the remained, you could useString.match()like so: