Change color of Textbox with onclick event of button

I am really new to web pages. and this site makes many things very easy to use your creativity to make some pretty cool pages.

I have a button on my page that i would like to make it turn the text in the textbox Green. below is an attempt of pasting code without it looking so messy.


export function button4_click(event, $w) {
//Add your code for this event here:
var document = document.getElementById(“text43”);
document.getElementById(“text43”).style.color = “green”;
}

Please help me learn by showing me what i am missing. Thanks for help in advance. :slight_smile:

Still not working. even after i am using the “$w” API.

Hi,
Please check out the style API here .
The code should look more like this:

$w("#myElement").style.backgroundColor = "green";

Good luck :slight_smile:


Above is a screenshot. what am i missing? a global call?