<form method="POST" action="/" id="form">
<label><input type="checkbox" name="svois[]" class="svois" value="7"> Высота</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="8"> Количество</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="9"> Назначение</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="10"> Способ изготовления, метод производства</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="11"> Диаметр</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="12"> Вид обработки</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="13"> Тип покрытия</label><br/>
<label><input type="checkbox" name="svois[]" class="svois" value="14"> Форма</label><br/>
<input type="submit" value="Отправить">
</form>
<script>
$(function(){
var form = $('#form');
form.on('submit', function(e){
e.preventDefault();
$.ajax({
type: form.attr('method'),
url: form.attr('action'),
data: form.serialize(),
success: function(result)
{
console.log( result );
}
});
});
});
</script>
$(document).ready(function () {
var table = $('table');
var cells = table.find('td');
var firstCorner, secondCorner, val;
function getCellIndex(cell) {
return {
x: $(cell).index(),
y: $(cell).parent().index()
};
}
function getRangeFromCorners(firstCorner, secondCorner, axis) {
var from, to;
if (firstCorner[axis] < secondCorner[axis]) {
from = firstCorner[axis];
to = secondCorner[axis];
}
else {
from = secondCorner[axis];
to = firstCorner[axis];
}
to = ':lt(' + ( to - from + 1 ) + ')';
from = from > 0
? ':gt(' + ( from - 1 ) + ')'
: '';
return from + to;
}
function onSelectEnd() {
cells.off('mouseover.selectRange');
table.find('.selected')
.removeClass('selected')
.html(val);
}
cells.on('mousedown', function () {
firstCorner = getCellIndex(this);
secondCorner = getCellIndex(this);
val = $(this).text();
cells.each(function () {
$(this).data('oldval', $(this).html());
});
cells.on('mouseover.selectRange', function () {
secondCorner = getCellIndex(this);
var rangeX = getRangeFromCorners(firstCorner, secondCorner, 'x');
var rangeY = getRangeFromCorners(firstCorner, secondCorner, 'y');
cells.filter('.selected').each(function () {
$(this).removeClass('selected')
.html($(this).data('oldval'));
});
table.find('tr' + rangeY).each(function () {
$(this).find('td' + rangeX)
.addClass('selected')
.html(val);
});
});
$('body')
.on('mouseup.removeCellListener', function () {
$(this).off('mouseup.removeCellListener');
onSelectEnd();
})
.on('mouseleave.removeCellListener', function () {
$(this).off('mouseleave.removeCellListener');
onSelectEnd();
});
});
});
<link rel="stylesheet" href="http://harvesthq.github.io/chosen/chosen.css">
<script src="http://code.jquery.com/jquery-1.12.1.min.js" type="text/javascript"></script>
<script src="http://harvesthq.github.io/chosen/chosen.jquery.js" type="text/javascript"></script>
<select name="brend" class="brendid" data-placeholder="Выберите бренд" id="brendid" style="width:250px;">
<option value="1">Первый</option>
<option value="2">Второй</option>
<option value="3">Третий</option>
</select>
<script type="text/javascript">
$(function () {
var select = $('#brendid');
select.chosen();
select.find('option').removeAttr('selected')
.last().attr('selected', 'selected');
select.trigger('chosen:updated');
select.on('change', function () {
alert($(this).val());
});
});
</script>
$(this).toggleClass('active');
// ...
if ($(this).hasClass('active'))
$(this).removeClass('active');
else
$(this).addClass('active');
// ...
element.classList.toggle('active');
// ...
if (element.classList.contains('active'))
element.classList.remove('active');
else
element.classList.add('active');
$(document).ready(function () {
var loginBtn = $('#login-trigger');
var signupBtn = $('#signup-trigger');
loginBtn.click(function () {
if (signupBtn.hasClass('active')) signupBtn.trigger('click');
$(this).next('#login-content').slideToggle();
$(this).toggleClass('active');
if ($(this).hasClass('active')) $(this).find('span').html('▲')
else $(this).find('span').html('▼');
});
signupBtn.click(function () {
if (loginBtn.hasClass('active')) loginBtn.trigger('click');
$(this).next('#signup-content').slideToggle();
$(this).toggleClass('active');
if ($(this).hasClass('active')) $(this).find('span').html('▲')
else $(this).find('span').html('▼');
})
});
var a_pattern = /^[а-яa-z ]+$/i;
var b_pattern = /^.+@.+\..+$/i;
var c_pattern = /^[0-9a-z]+$/i;
// ...
var a = obj.name.value;
var b = obj.email.value;
var c = obj.pass.value;
console.log(a);
console.log(b);
console.log(c);
// ...
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<img src="#" id="img_load">
<a href="#" name="button1" data-num="1" class="button">кнопка</a>
<a href="#" name="button2" data-num="2" class="button">кнопка</a>
<a href="#" name="button3" data-num="3" class="button">кнопка</a>
<a href="#" name="button4" data-num="4" class="button">кнопка</a>
<div class="results"></div>
<script language="javascript" type="text/javascript">
$('.button').on('click', function(e){
e.preventDefault();
var img = $('#img_load');
var current = $(this);
var buttons = $('.button');
$.ajax({
type: 'POST',
url: 'setings.php',
data: 'btn=' + current.data('num'),
success: function(data){
$('.results').html(data);
buttons.each(function(){
$(this).html( 'Кнопка ' + $(this).data('num') );
});
current.html( 'Кликнули сюда' );
img.attr('src', 'image url');
}
});
});
</script>