jQuery Error - Not a valid function.
Getting
$(this).attr("id").val is not a function error with the code below.
- $(document).ready(function() {
$('.AdminDisableClick').click(function() {
enabledisable($(this).attr("id").val());
});
function enabledisable (id) {
$.post("/Admin/AdminEnableDisable", { TemplateId: id }
)}
});
I know it has to do with enabledisable($(this).attr("id").val());
I'm trying to pull the value from the DOM.
- <a id="49" class="AdminDisableClick" href="#">
Being relatively new at jQuery, I don't know what is wrong and how to fix it. Any help would be appreciated.