jquery - Javascript Namespace called using variable -
i have defined namespace: cookies
, under showlabels
, showoptions
i want able call namespace on page using jquery val assuming either return showlabels
or showoptions
ie:
cookies.$.trim($(this).val())
how can this?
use square brackets access property string name:
cookies[$.trim($(this).val())]
Comments
Post a Comment