web development
<div class="align_center">
<div class="btn EmployeeloginBtn" **onclick="new Employee().connect()**>CONNECT</div>
</div>
Employee.js:
var Employee = function() {
var self = this;
self.connect = function ()
{
var phone = $("#phone").val();
var regSeven = /^7[0-9].*$/
var regEight = /^8[0-9].*$/
if($("#empId").val() =='')
{
alert("invalid employee id");
return false;
}
if(phone =='')
{
alert("invalid phone number");
return false;
}
}
};
Unfortunately, when I click the button, the onclick function is not working and it's not triggering to Employee.js file.