I have the following html generated by shortcodes generated by functions.php in a WordPress parent theme:
<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:info@domain.nl?subject=Informatie Restaurant">Voor meer informatie – Email ons</a>
</div>
</div>
</div>
I need to make one of the titles in a cell or the div containing it a link to a pdf. I read here that I can do this on an id with jQuery like so:
$("div").click(function(){
window.location=$(this).find("a").attr("href"); return false;
});
But his is only working when you change the html. I prefer a Jquery or JavaScript solution only. On CSS Tricks I found another snippet that may help
$(".myBox").click(function() {
window.location = $(this).find("a").attr("href");
return false;
});
I only would need to change the a element to div and the class to the class of the div. However, I need this done with a few specific divs (some items inside the table, but not all) and it only has one sort of useful class:
<div class="pricing-table-one-center pricing-table-white left"><h5>BRUNCH</h5></div>
Perhaps by focussing on parent div with class "pricing-table-one" and then the div inside it. But then I still need the nth div or h5 tag..
Is this possible to achieve creating a link of BRUNCH or other h5 tags with this exising HTML code with JavaScript or jQuery or will I have to change to PHP code server side?