<script>
const persons = {
Armine: {
name: 'Արմինե',
zag: 'Վարսավիր',
image: '3.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae aspernatur sunt, atque nisi error quasi dolores itaque saepe ullam. Numquam deleniti delectus laboriosam repellendus illo.'
},
Hovik: {
name: 'Հօվիկ',
zag: 'Վարսավիր',
image: '2.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero error mollitia sit modi consectetur, nostrum, ipsam doloribus culpa? Numquam itaque autem repellat. In, ab natus!'
},
Karen:{
name: 'Կարեն',
zag: 'Վարսավիր',
image: '1.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eaque nobis placeat eos perspiciatis consectetur accusantium, tempore numquam repudiandae accusamus quisquam, non voluptatum suscipit praesentium distinctio.'
},
Marine:{
name: 'Մարինե',
zag: 'Դիմահարդար',
image: '3.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum pariatur doloremque quasi quibusdam soluta, sunt illo obcaecati, aspernatur ullam adipisci repellendus eos culpa similique nesciunt?'
},
Satenik:{
name: 'Սաթենիկ',
zag: 'Դիմահարդար',
image: '2.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore error magnam sapiente ab, explicabo nulla architecto temporibus delectus voluptatem, sed voluptatum optio eveniet rerum quaerat.'
},
Gayane:{
name: 'Գայանե',
zag: 'Մատնահարդար',
image: '2.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur voluptatibus nulla culpa nobis, eligendi ipsum assumenda ab cum alias! Ipsa aperiam doloribus alias. Ut, veniam.'
},
Satenik_k:{
name: 'Սաթենիկ Կիրակոսյան',
zag: 'Մատնահարդար',
image: '1.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nihil odit, quos quisquam veritatis corrupti perspiciatis provident fugit debitis cum vel facilis voluptate ratione, nesciunt molestias.'
},
Artak:{
name: 'Արտակ',
zag: 'Ասեղնաբույժ',
image: '3.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vel, dignissimos, dolore. Inventore iste libero commodi nulla dolore cum nam minus rerum, earum, dolor blanditiis voluptatem.'
},
Karine:{
name: 'Կարինե',
zag: 'Մերսող',
image: '3.jpg',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur obcaecati pariatur eaque libero, facere numquam excepturi tempore voluptate id architecto necessitatibus odit nemo aliquid consequatur!'
}
};
var special = {
barber: [ persons.Armine.name, persons.Hovik.name, persons.Karen.name],
manicure:[ persons.Marine.name, persons.Satenik.name ],
makeup: [ persons.Gayane.name, persons.Satenik_k.name ],
surgeon: [ persons.Artak.name ],
massage: [ persons.Karine.name ]
};
var specialist = document.getElementById('s_section'); //out
var person = document.querySelector('#s_employee'); //in
specialist.onchange = selectPerson; //function
function selectPerson(ev) {
person.innerHTML ="";
var c = this.value, o;
for (let i = 0; i < special[c].length; i++) {
o = new Option(special[c][i],i,false,false);
person.add(o);
}
};
var cart = $('.person_card'); // div cart
var child = cart[0].children; // all children
var name, zag, img, desc; // childrens variable
person.onchange = function () {
name = $(child[0]).html(persons.Armine.name);
zag = $(child[1]).html(persons.Armine.zag);
img = $(child[2]).attr({src: persons.Armine.image});
desc = $(child[3]).html(persons.Armine.description);
};
console.log(Object.keys(persons).length); //lenght card massiv
console.log(Object.keys(special).length); // lenght select massiv
console.log(person[0].innerText);
var b = special.barber.length+special.makeup.length+special.manicure.length+special.surgeon.length+special.massage.length;
console.log(b);
// var x = ?
// html(persons.x.name);
</script>