I am using a WordPress website and trying to attach a url to a button using JavaScript. I have written a function to this, My function as follows.
<div class="the_course_button" data-id="3565"><div class="course_button full button"><a href="https://gutsycreatives.com/course/writing-game-gala/?renew">TAKE THIS COURSE</a></div></div>
jQuery(document).ready(function ($) {
$('#3565').each(function() {
var link = $(this).html();
$(this).contents().wrap('<a href="https://gutsycreatives.com/product/writing-game-gala/"></a>');
});
});
I passed my data-id '#3565' to call the function. Now I am getting nothing
What did I do wrong here?
I appreciate the help thanks so much.