I'm new to StackOverflow and needed some help with the following JavaScript, jQuery question.
Is there a more concise way to code the following?:
jQuery(document).ready(function () {
$("#article1").click(function(){
showarticleDescription(id=1);
})
$("#article2").click(function(){
showarticleDescription(id=2);
})
$("#article3").click(function(){
showarticleDescription(id=3);
})
$("#article4").click(function(){
showarticleDescription(id=4);
})
$("#article5").click(function(){
showarticleDescription(id=5);
})
})
showarticleDescription(id=1)(or any other number)? While this isn't invalid syntax, this isn't Python either and there isn't any key value thing going on here; the closest thing you'll get are objects.