Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 3 years ago.
Improve this question
$(document).ready(function(){
$('button').click(function() {
alert($(this).attr('value'));
})
});
For some reason when I click any button I am not getting my desired result which is an alert box that prints the number labelled on the clicked button. I want this alert message to pop up if any button is clicked.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)