Reputation: 59
how can I use tooltip plugin with JQuery selector? I used this:
<span class="tooltip" title="You can use letters">
but I want to write it with selectors, I did this:
<script>
$('#name1').ready(function() {
Tipped.create('#name1', 'create-tooltip');
});
</script>
but it does'nt work, can anyone help me with it?
Upvotes: 0
Views: 44
Reputation: 59232
Replace $('#name1').ready
with $(document).ready
.
The purpose of using .ready
is to safely use elements after they are present in DOM.
When you did $('#name').ready
, element with id name1
wasn't probably existed in the DOM, which might as well be the reason, why your code didn't work.
Upvotes: 1