You need to specify the parameter/argument to the test()
function.
$('#element').click(function(){
test(somedata);
});
function test(arg1){
alert(arg1);
}
Take a look at Function MDN document.
More Related Contents:
- .val() don't edit input
- weird thing. working fiddle doesn’t work on html [closed]
- HTML text input allow only numeric input
- Get querystring from URL using jQuery [duplicate]
- How can I change an element’s text without changing its child elements?
- jqgrid incorrect select drop down option values in edit box
- how does jquery chaining work?
- Convert image from url to Base64
- Persisting the changes of range objects after selection in HTML
- Generating non-repeating random numbers in JS
- What is the meaning of symbol $ in jQuery?
- How do I detect “shift+enter” and generate a new line in Textarea?
- Sort an array by the “Levenshtein Distance” with best performance in Javascript
- HTML5 Local Storage fallback solutions [closed]
- Capture keys typed on android virtual keyboard using javascript
- JS setInterval executes only once
- Get URL from background-image Property
- jquery validate plugin on dynamic form inputs not working
- Ways to add javascript files dynamically in a page
- CORS not working on Chrome
- Disabling browser tooltips on links and s
- jQuery UI autocomplete with item and id
- Add a transform value to the current transforms that are already on the element?
- Search and Highlight in jQuery
- Convert String to XML Document in JavaScript
- What is the concept of Array.map?
- How to remove all click event handlers using jQuery?
- How to get form data as a object in jquery [duplicate]
- does location of e.preventDefault() matter
- How can I calculate the difference between two times that are in 24 hour format?