• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Javascript in a Multiple Choice Slide

New Here ,
May 10, 2015 May 10, 2015

Copy link to clipboard

Copied

Hi everybody,

My client wants the following: when users select one of the radio buttons of the possible answers, the send button color should change from grey to red.

The project will be published as HTML.

I am trying to do this by changing the visibility css property of the button element with javascript. I have emebeded the following code (and several variations) in the on enter action / execute javascript script window targeting the div of the first posible answer:

window.onload = function() {

  var answerMC1 = document.getElementById("si11842ch_highlight");

  answerMC1.onclick = showButton;

  

    function showButton(){

     document.getElementById("RedButton").style.visibility = "visible" ;

    }

}

This is not working, it seems that the windows.onload event handler  it's not doing what it is supposed to do, wait for the windows to load... ¿Should I use the moduleReadyEvent event??

I will apreciate very much your help!

Oriol

TOPICS
Advanced

Views

146

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Help resources