[Solved] Changing Dom to Jquery [closed]


For jQuery you can write.

var x = $('#x');

x.mouseup(function(e) {
   e.preventDefault();


});

Learn all about jQuery Selectors: http://api.jquery.com/category/selectors/

Here is a link to a JSFiddle http://jsfiddle.net/6ZBx7/ showing very basic usage. YOu will notice if you type in the box and press the button the text is copied to the textarea. For demo purposes also added another event handler of mousedown that clears the textarea. This is to show using different handlers on the same element using selectors.

Note the ids dont contain the ‘#’ in Html. The ‘#’ selector tells jquery to find all elemetns that match the ID. Similarily you can use the ‘.’ selector (ie .myClass) to find all elements that have a specific class.

6

solved Changing Dom to Jquery [closed]