I managed to add toggle'able additional text into my main text. Is there a possibility to change the background of the toggle text? I searched the code API explanations, but when i use that code, the word style is underlined red, as if there was a mistake in it. Here is the line i put into my code:
$w('#Dproc01').style.backgroundColor = "#FF000000"; I am a newbie in wix API, sorry for that :)
Looking at source code from browser i see, that the text i have entered via Wix visual editor is inside a div. And i manage to toggle that div open and close. How come i am not able to change the style of that div through code? I still think it should be possible somehow...
If i use html, then all formatting is lost and sadly also this span replaces the p i have entered via wix visual editor...
Thanks, but your solution makes my text invisible. #Dproc01 is i guess a text element? As in the Wix visual editor i have the option "Edit text", but nothing else. When i look at the source in browser its: <p class="font_8">my text</p>
What kind of element is $w('#Dproc01')? On a text element you can use the HTML property to get than through code. use the .html = "<span style='background-color:#223344'>your text here</span>"
Read more
https://www.wix.com/code/reference/$w.Text.html#built-in-text-themes