There seems to be a lot of problems with the code you posted in your question. First, (unless you use <!DOCTYPE html> as your doctype), you cannot have id values ββstarting with a number.
Secondly, jQuery (I assume it is jQuery and not some other JS library) in your getUniqueButtonValue function getUniqueButtonValue not work, because the selector will look for the value element, which is unlikely to exist.
I assume that the value attribute of your button intended to match the id another element that you want to hide when the button is clicked.
Since you have jQuery code in your example, I will give you a jQuery solution since it is much simpler:
$(document).ready(function() { $("button").click(function() { alert(this.value); $("#" + this.value).hide(); }); });
In addition, you do not close the body tag, but I assume that this is just a mistake when copying and pasting the code into the question.
source share