Question: 1.can someone fix this code for me please Add Edit Remove HTML Table Row .container{overflow: hidden} .tab{float: left;} .tab-2{margin-left: 50px} .tab-2 input{display: block;margin-bottom: 10px} tr{transition:all
1.can someone fix this code for me please
.container{overflow: hidden}
.tab{float: left;}
.tab-2{margin-left: 50px}
.tab-2 input{display: block;margin-bottom: 10px}
tr{transition:all .25s ease-in-out}
tr:hover{background-color:#EEE;cursor: pointer}
| First Name | Last Name | |
|---|---|---|
| A1 | B1 | |
| A3 | B3 | |
| A2 | B2 |
First Name :
Last Name :
Email :
class Entrie{
constructor(name, telephone, email){
this.name = name;
this.telephone = telephone;
this.email = email;
}
}
class Contacts{
constructor(){
this.contact_list = [];
}
addcontact(entrie){
if(/^[a-zA-Z0-9.!#$%&'*+/=?^`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/.test(entrie.email))
this.contact_list.push(entrie);
else{
alert("Invalid email")
}
}
delete_contact(entrie){
let confirm = window.confirm("Sure you wanna delete this entry ?");
if(confirm){
let temp_list = this.contact_list.filter(item=> (item.name != entrie.name) && (item.telephone != entrie.telephone) );
this.contact_list = temp_list;
}
}
search_contact(text){
let result = this.contact_list.filter(item=> item.name.match(text) || item.telephone.match(text) || item.email.match(text));
return result;
}
sort_contact_list(criteria){
if(criteria == "name"){
this.contact_list.sort((a,b)=>a.name > b.name)
}
else if(criteria == "email"){
this.contact_list.sort((a,b)=>a.email > b.email)
}else{
this.contact_list.sort((a,b)=>a.telephone > b.telephone)
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
