I have created a button as
<button type="button" name="createTask" id="createTaskNOw" class="createButton" createtype="task" onclick="components.init(this)" >Add Task</button>
I also have an external javascript file which have this component.init method where I want to retrieve the custom attribute. So I am doing the following
var components = function(){
var _init = function(attributes){
console.log("Method Executing:Compnents.init",attributes.createtype);
}
return {
init:_init,
}
}()
When I am logging attributes like name or id I can see the expected result but logging createtype is showing undefined. Is there anything wrong in custom attributes.