Iladarsda Iladarsda - 1 year ago 109
Javascript Question

jQuery - trim the variable

I have following example:

var VarFull = $('#selectror').attr('href')
where
.attr('href') = "#tabs1-1"


How can I trim that to
"tabs1-1"
( without
#
)??

Any suggestions much appreciated.

Answer Source

Use substring:

var VarFull = $('#selectror').attr('href').substring(1);