This is my function I'm trying to get button's value and display HTML for every element correctly but when I do a click on my button I have this error.
function prueba() {
var value = $("button").val();
alert(value);
}
This is my button
var btnbp1 = document.createElement('button');
btnbp1.value = '0';
btnbp1.setAttribute('onclick', 'selection()');
btnbp1.className = 'windowprimarybutton';
var btnBp1Img = document.createElement('img');
btnBp1Img.src= 'images/bp1.jpg';
btnbp1.appendChild(btnBp1Img);
divButtonsConteiner.appendChild(btnbp1);