jquery - Attach a JavaScript function to a standard link that would handle the request? -
On my page I have several DIVs related to the same category and with the automatically generated links by the flow doc There are small statements for @mants).
Is not a user to redirect any other URL, instead of calling on that function instead of calling on that link, which will filter the statements given on that page, will show only The Dietary Div in which @Myt was clicked?
Here's an example:
& lt; Div class = 'entry' data-hashtag = '# supermarket # feed # alcohol' & gt; & Lt; P & gt; #supermarkets #food and #lcohol and lt; A title = "search @ personal" category = "app-tag-link" href = "/ context / @ personal" & gt; @ Private & lt; / A & gt; & Lt; / P & gt; & Lt; / Div & gt;
The user clicks on private and instead of going to context / personal / a javascript function is said to filter the DIV via jQuery, as it is.
Thank you for your help!
Of course - you want to add the listener to the link and (e) {e.preventDefault (); // filter}); Using jQuery: call < Pre>
element.addEventListener ('click on', without using the function)
// jQuery object element The selected group of (s) keeps JQueryObject.on ('click', function (e) {e.preventDefault (); // filter});
Comments
Post a Comment