I try to make a simple button with jQuery that executes some javascript when clicked. I know there are many articles covering this but I still have some questions.
I first worked with an a element and put onlick in the href parameter, this was the wrong way to do it, so I changed it and later on I had an idea that made everything really easy (designwise). I made a div (in most cases) and with jQuery I coded that if the div was clicked, some scriptwork should run, like this;
This seemed to be a good solution, but is it really? If it is, then there's another problem.Code:<div id="clickMe">Click me</div> <script> $("#clickMe").click(function () { /* some script */ }); </script>
When I click such 'link' more than once I begin to select/highlight elements on my page. Normal behaviour ofcourse, but how do I stop this?
Thank you in advance.



Reply With Quote




Bookmarks