hasattribute is not a function code example
Example 1: setattribute is not a function jquery
Use jquery.attr() like,
$(txtEndDate).attr('dateInRegionalFormat', txtEndDate.value);
Updated there may be multiple elements so use [0] for the first element like,
txtEndDate[0].setAttribute('dateInRegionalFormat', txtEndDate.value);
Example 2: hasOwnProperty is not a function
// Calls "hasOwnProperty" on queryData, even if queryData has
// no prototype:
console.log(Object.hasOwnProperty.bind(queryData)('session'));