Code that I wrote is as below.
<div><a class="skill_1">skill</a></div>
<p id="skill_desc_1">skill description - 1</p>
Below JS code is expected to load popup window upon click on .skill_1 element. however, somehow after first click on .skill_1, whenever I click on elsewhere of website, the click event is executed. as I'm pretty new with JS, I'm really struggling to find out the cause of the issue. perhaps I wrote totally wrong code, can somebody help me out?
I'm using popup.js plugin just for information.
$(document).ready(function () {
/* Forcing hidden content to each skill item */
var options = { content: $('#skill_desc_1')};
/* popup skill description */
$('a.skill_1').click(function(){
$(this).popup(options);
});
});