Does javascript work fully in Widget Option area?
-
Hi All,
I have a number of options for my widget and I wanted to give a little popup info for some of them. In my function form, I am trying the following code. But it does not work. However, if, instead of removing the class, I use “alert(‘test’); it works. So, javascript works. But for some reason I cant change this element. I have also tried with inline styling and jQuery but none seems to work. Ultimatley I plan on making this a popup with display attribute, but just trying to get any js working. Am I doing something wrong or is this somehow blocked on the Widget options page?
_e('<style type="text/css">.chpop {color:blue;}</style>'); _e('<div class="chpop" id="chPop">bbbbbbbbbbbbbbbbb</div>'); //_e('<span onClick="document.getElementById(\'chPop\').style.color=\'green\';">xxxxx</span>'); _e('<span onClick="document.getElementById(\'chPop\').classList.remove(\'chpop\');">xxxxx</span>');
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Does javascript work fully in Widget Option area?’ is closed to new replies.