After using shortcodes generated by functions.php in a WordPress parent theme, I have come across the following HTML code:
<div class="pricing-table-one left full-width ">
<div class="pricing-table-one-border left">
<div class="pricing-table-one-top pricing-table-green left" style="background:#95705b">
<span style="color:">Restaurant / Café</span>
<p style="color:"></p>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>ONTBIJT</h5>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>LUNCH</h5>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>BRUNCH</h5>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>DINER</h5>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>WEST-FRIESE KOFFIETAFEL</h5>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>SALADESCHOTELS</h5>
</div>
<div class="pricing-table-one-center pricing-table-white left">
<h5>EN NOG VEEL MEER</h5>
</div>
<div class="color-buttons color-button-blue pricing-button">
<a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c05020a032c0803010d0502420200">[email protected]<a>">Voor meer informatie – Email ons</a>
</div>
</div>
</div>
I am looking to create a link for one of the titles inside either a cell or its containing div that will lead to a PDF. While researching, I found out about using jQuery to achieve this but it requires modifying the HTML structure. I am looking for a solution solely based on jQuery or JavaScript. I also came across a helpful snippet from CSS Tricks.
$(".myBox").click(function() {
window.location = $(this).find("a").attr("href");
return false;
});
The challenge lies in targeting specific divs within the existing HTML code and making them clickable links. For example:
<div class="pricing-table-one-center pricing-table-white left"><h5>BRUNCH</h5></div>
Is there a way to turn the "BRUNCH" title into a clickable link using JavaScript or jQuery without altering the original PHP server-side code?