I am building a jQuery plugin and i’m using a variable in it which can be an class or id. I dont want to use the . or # in the variable, so is there an way to check if an variable is a class or id.
Coudn’t find anything on the web about this.
some of the code
var defaults = {
trigger: ''
};
var opt = jQuery.extend(defaults, opt);
jQuery(opt.trigger).click(function(){
//run code
});
Check for