[ad_1]
For a car rental website, there will be 4 vehicle color option buttons. Clicking one of these should change the hyperlink address in the “Book Now” button. Im trying to do this without having to reload the whole page everytime. Is this possible on WordPress/ Elementor?
[ad_2]
I don’t know about elementor I doubt it’s an out of the box solution but it can be achieved with some Javascript. Essentially the colour choices would have click events on them that modify the href attribute if you book button.
Basically you need this kind of thing:
<script type=”text/javascript”>
jQuery(document).ready(function(){
jQuery(‘#somebutton’).click(function(){
jQuery(‘.a_target_element’).html(‘The new content such as a URL’);
});
});
</script>
Add it to the footer, or drop it in a code block on the page… set #somebutton to the ID of your colour selector… set .a_target_element to the class (or #target ID) of your button with the URL.
This changes the HTML content… I don’t know how your stuff is done, so you may need to modify it.