let tab = document.querySelectorAll('.page-services-item'),
info = document.querySelector('.page-services-list'),
tabContent = document.querySelectorAll('.services-list__wrap'),
titleTab = document.querySelector('.page-services-title__wrap');
info.addEventListener('click', function(event) {
let target = event.target;
if (target && target.classList.contains('page-services-item')) {
for(let i = 0; i < tab.length; i++) {
if (target == tab[i]) {
let content = tab[i].innerHTML;
titleTab.innerHTML = content;
tab[i].classList.add('hide'); ///Вот тут на определённую ссылку из массива я навешиваю класс
hideTabContent(0);
showTabContent(i);
} else {
tab[i].classList.remove('hide');
}
}
}
})
$url = $url_get_kbm2."?".http_build_query($arr_post_out);
$out_txt = file_get_contents($url);
$data = json_decode($out_txt,true);
foreach($data['response']['items'] as $val) {
echo 'Госномер: '.$val['gosnumber'].' / Марка: '.$val['mark'];
}
let obj = {
"BIRZHASP":[
{
"Code":"1",
"ForAbonentType":"ip"
},
{
"Code":"2",
"ForAbonentType":"ul"
}
],
"BIRZHASPF":[
{
"Code":"3",
"ForAbonentType":"ip"
},
{
"Code":"4",
"ForAbonentType":"ul"
}
]
};
let arr = [
{
serviceTypes: ['BIRZHASP', 'BIRZHASPF']
qualNames: {
ip: какой то код
ul: какой-то код
};
}
];
arr.foreach(elem => {
elem.serviceTypes.forech(e => {
if (obj.hasOwnProperty(e)) {
elem.qualNames.ip = obj[e][0].ForAbonentType;
elem.qualNames.ul = obj[e][1].ForAbonentType;
}
});
});
div {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
not supported by any browser */
}
<td class="zero">
<span>1</span<br>
<span>27.04.2020</span><br>
<select>
<option value="0" selected="">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</td>
<td>
<input type="text" value="asdasdasdasdasd"><br>
<input type="text" value="asdasdasdasdsa"><br>
<input type="text" value="dasdasdasdas">
</td>
<td>
<textarea>Примечание</textarea>
</td>
input, textarea, select, option {
height: 35px;
display: block;
padding: .3em;
width: var(--fullin);
color: var(--dark);
background-color: var(--white);
border: 2px solid var(--dark);
border-radius: 3px;
}
textarea {
height: 109px;
resize: none;
}
tr {
display: flex;
text-align: center;
border-top: 1px solid var(--dark);
}
td {
padding: .1rem;
width: var(--fullin);
}
tbody > tr {
min-height: 100px;
}
span {
display: block;
}
var arr = [{ "Name": "Alex", "sex":"man","age":50,"workplace":"office"},
{"Name": "Katya", "sex":"woman","age":33,"workplace":"office"},
{"Name": "Igor", "sex":"man","age":22,"workplace":"park"},
{"Name": "Olga", "sex":"woman","age":19,"workplace":"park"},
{"Name": "Maks", "sex":"man","age":40,"workplace":"hotel"}
var arr2 = [];
for(var prop in arr){
if(arr[prop].workplace == "office" || arr[prop].workplace == "hotel"){
arr2.push(arr[prop]);
}
}
div * {opasity: 0;}
let parentElement = document.querySelector('div').parentNode;
parentElement.addEventListener('click', function (e) {
let elemArr = e.target.children;
for(let i = 0; i < elemArr.lenght; i++) {
elemArr[i].style.opasity = '1';
}
});
<select class="custom-select sel_auto_mod" name="card" id="card">
<select name="paper" id="paper" class="sel_serv_mod" multiple>
<?-- заменить на -->
<select name="paper" id="paper" class="sel_serv_mod">