Iladarsda Iladarsda - 4 months ago 20
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

Use substring:

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