JavaScript
1
Вклад в тег
<div class="button">Button</div>
<div class="class-main">
<div class="class">1</div>
<div class="class">2</div>
<div class="class">3</div>
</div>
<script type="text/javascript">
document.getElementsByClassName("button")[0].onclick=function(){
console.log(document.getElementsByClassName("class")[1])
}
</script>
$(document).ready(function() {
$('.mark-error').click(function() {
var error_code = $(this).data('code');
var error_defect = $(this).data('defect');
var error_mark = $(this).data('mark');
var error_type = $(this).data('type');
$('#error-input').val(error_code);
$.post("/assets/main/php/errors-new.php", {
code: error_code,
mark: error_mark,
defect: error_defect,
type: error_type
},
onAjaxSuccess
);
function onAjaxSuccess(data) {
$('.error-salvation').html(data);
//alert(error_defect);
$('.error-list').slideUp(100);
$('.error-list').removeClass('ext');
}
});
});