Find a control with javascript

Posted by Community Admin on 03-Aug-2018 20:58

Find a control with javascript

All Replies

Posted by Community Admin on 21-Nov-2011 00:00

I want to change the value of an <a> that I have embedded in a content block with javascript.

Here is the tag
<a href="#" name="bgController" onclick="defaultImage()">Turn background off</a>

My javascript does not find the control - is this because the control is in a content block?

Thanks

Ron


Here is the javascript

function defaultImage()
    var theLink = document.getElementById("bgController");
 
    if (theLink.value == 'Turn background off')
        document.body.className = "defaultBG";
        theLink.value = 'Turn background on';
    
    else
        document.body.className = "schoolBG";
        theLink.value = 'Turn background off';
    

Posted by Community Admin on 23-Nov-2011 00:00

Hi Ron,

I answered you question in the other forum thread.

Greetings,
Lubomir Velkov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-Nov-2011 00:00

Thanks!!

I couldn't find my original post - sorry for the double post

Thanks again for all the help

Ron

This thread is closed