Revision history [back]

click to hide/show revision 1
initial version

asked 2021-04-05 08:29:57 +0800

NouserTag gravatar image NouserTag

Update style with a button

Hi,

I whould like to make a simple program that would change the color of the button everytime I clik on it, the style is saved in a style tag.

My problem was, when I click on the button, the color didn't change to the one I asked for, and stayed the same.

Thanks for the help in advance!

Update style with a button

Hi,

I whould like to make a simple program that would change the color style of the button div everytime I clik on it, a button, the style is saved in a style tag.

My This line works fine, the problem was, when is the next one:

<button id="ok" label="Submit" &gt;="" <attribute="" name="onClick"> percentagem.setStyle("--angulo: 100deg;"); </attribute> </button>

It simply remove the style from the div, I click checked that with the html code on the button, the color didn't change to the one I asked for, and stayed the same.browser.

Thanks for the help in advance!

Update style with a button

Hi,

I whould like to make a simple program that would change the style of the div everytime I clik on a button, the style is saved in a style tag.

<div sclass="sc-percentage" id="percentagem" style="--angulo: 20deg;" ></div>

This line works fine, the problem is the next one:

<button id="ok" label="Submit" &gt;="" <attribute="" >
  <attribute name="onClick">
     percentagem.setStyle("--angulo: 100deg;");
   </attribute>
</button>

</button>

It simply remove the style from the div, I checked that with the html code on the browser.

(If this helps)

<style>
   .sc-percentage { position:absolute; top:100px; left:-200%; width:400%; height:400%; margin-left:100px; background-color:#ef0000; }
    .sc-percentage { transform:rotate(var(--angulo)); transform-origin:top center; }
</style>

Thanks for the help in advance!

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More