John Davidson

javascript - change button link on click of select option

0 comments
Message:


My html code


<select>
<option>monthly</option>
<option>annually</option>
<option>triennially</option>
</select>

<div class="pricing-btn">
<a href="<?php echo $ButtonLink1; ?>" class="btn"> Get started</a>
</div>
<div class="pricing-btn">
<a href="<?php echo $ButtonLink2; ?>" class="btn"> Get started</a>
</div>
<div class="pricing-btn">
<a href="<?php echo $ButtonLink3; ?>" class="btn"> Get started</a>
</div>

When monthly option is selected div with $ButtonLink1 should be visible.


When annually option is selected div with $ButtonLink2 should be visible.


When triennially option is selected div with $ButtonLink3 should be visible.


Default visible value should be monthly option and div with $ButtonLink1.


Can anyone please tell me how to write script to achieve this?



My Answer:



Change Button Link on Select Option






Rate this post

3 of 5 based on 3525 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us