This is the div on the website for a specific booking - in this example, the number 7568 is the tour ID.
<div class="tourmaster-template-wrapper" id="tourmaster-payment-template-wrapper" data-ajax-url="https://www.domainname.co.uk/wp/wp-admin/admin-ajax.php" data-booking-detail="{"tour-id":"7568"} >
For a specific tour ID, I want to hide another div on the page, so if the data booking details contains certain numbers, is there a way to apply CSS to another div on the page?
So if data-booking-detail contains 7568, hide the div that offers book now and pay later.
First, select a specific element. In your case, the element has the ID
This is an example of how to hide the second element:tourmaster-payment-template-wrapper
, and you are looking for the attributedata-booking-detail
## that contains the value
7568 #.You can use CSS to hide a div based on the presence or absence of a specific number in the data-booking-detail attribute. However, CSS itself cannot directly manipulate properties or their values. You need to use JavaScript or jQuery to achieve this functionality.
Here's an example of how to do this using JavaScript: