Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,
i Created four anchor button.when i click one button it's become active,after that i click that second button that become active remaining are becoming normal.
starting the four button text and line color is blue,when i click first anchor button the first anchor button text and line color become red remains anchor button's text and line color same,like that the second,third and fourth

below i am sharing my code.

XML
<div  style="text-align:left">'
<iframe width="860" height="405" src="#" name="frame" frameborder="0" allowfullscreen></iframe>
<div style="text-align:left">'
<a href="#" x align="left" target="frame" id="1day">1Day</a>&nbsp;&nbsp;
<a href="#" align="left" target="frame" id="5day">5Days</a>&nbsp;&nbsp;
<a href="#" align="left" target="frame" id="3m">3Months</a>&nbsp;&nbsp;
<a href="#" align="left" target="frame" id="6m">6Months</a>&nbsp;&nbsp;
<a href="#" align="left" target="frame" id="1y">1Year</a>&nbsp;&nbsp;
<a href="#" align="left" target="frame" id="max">Max</a>&nbsp;&nbsp;
</div>


Please share any related code to me.
Posted
Updated 21-May-15 3:25am
v3
Comments
[no name] 21-May-15 8:57am    
What's ur problem ?
krish2013 21-May-15 9:27am    
Hi Rajesh,
Thanks for responding my post.myrequirement is like starting the four button text and line color is blue,when i click first anchor button the first anchor button text and line color become red remains anchor button's text and line color same,like that the second,third and fourth
can u please share any code to me.

1 solution

There is nothing to share. There is no need to "find" anything. Buttons cannot be "active" or "normal". They can have the input focus or not.

Perhaps you mean the "checked" state of control. The behavior you described corresponds to the set of radio buttons, not "regular" buttons:
http://www.w3.org/TR/html-markup/input.radio.html[^].

HTML
<form ...>
<input type="radio" value="1">1 Day</input>
<input type="radio" value="5">5 Days</input>
<!-- ... -->
<input type="radio" value="max" checked="checked">Max</input>
</form>


—SA
 
Share this answer
 
v4
Comments
krish2013 21-May-15 9:45am    
Hi Sergey,
Thanks for responding my post.myrequirement is like starting the four button text and line color is blue,when i click first anchor button the first anchor button text and line color become red remains anchor button's text and line color same,like that the second,third and fourth
can u please share any code to me.
Sergey Alexandrovich Kryukov 21-May-15 10:05am    
Please use the code I already shared. For colors and changes of color, use CSS (and nothing else!). If you don't know CSS, it will be a separate question. In general: learn HTML, JavaScript and CSS in general, all of it, at least in first reading, and only then ask your question, otherwise you won't get far. Don't learn by looking of available code, write code yourself. These topics (except JavaScript, which needs some real effort to grasp the main ideas) are fairly simple.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900