选择的单选按钮在通过单选按钮将所选颜色输出到页面或屏幕方面工作正常。
每个单选按钮代表不同的颜色。
我想知道是否可以使用某些java脚本来操作每种所选颜色的对比度。
例如,通过不断点击Color +按钮,我应该能够通过java脚本为选定的单选按钮颜色实现更暗的对比度,但是如何?
<script>
//The function inform is invoked when the user clicks the button
function inform()
{
alert("You have activated me by clicking the grey button! Note that the event handler is added within the event that it handles, in this case, the form button event tag")
}
</script>
<form>
<input type="button" name="test" value="Color+:" onclick="inform()">
</form>
<!--Given this javascript code:
Is there a way to make the value of the button actually change
the selected color's contrast to a darker contrast, such that if the user keeps pressing the button by clicking the mouse button while
on a selected color via the radio button, the selected color's contrast becomes becomes darker.-->
<form name="go">
<input type="radio" name="C1" onclick="document.bgColor='lightblue'">
<input type="radio" name="C1" onclick="document.bgColor='pink'">
<input type="radio" name="C1" onclick="document.bgColor='yellow'">
<input type="radio" name="C1" onclick="document.bgColor='lime'">
<!--Currently the user can select different colors via the radio box's.
But I wanted to somehow, have the click-eable box linked to the radio selections, such that when a color is selected
I can also change the color's contrast and make it dark.-->
</form>