<head>
<style>
body, select {
font-size: 12px;
}
form {
margin: 5px;
}
p {
color: red;
margin: 5px;
font-size: 14px;
}
b {
color: blue;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<form>
<select name="single">
<option>Single</option>
<option>Single2</option>
</select>
<br>
<select name="multiple" multiple="multiple">
<option selected="selected">Multiple</option>
<option>Multiple2</option>
<option selected="selected">Multiple3</option>
</select>
<br>
<input type="checkbox" name="check" value="check1" id="ch1">
<label for="ch1">check1</label>
<input type="checkbox" name="check" value="check2" checked="checked" id="ch2">
<label for="ch2">check2</label>
<br>
<input type="radio" name="radio" value="radio1" checked="checked" id="r1">
<label for="r1">radio1</label>
<input type="radio" name="radio" value="radio2" id="r2">
<label for="r2">radio2</label>
</form>
<p><tt id="results"></tt></p>
</body>
function showValues()
{
var str = $( "form" ).serialize();
$( "#results" ).text( str );
}
$( function()
{
$( "input[type='checkbox'], input[type='radio']" ).on( "click", showValues );
$( "select" ).on( "change", showValues );
showValues();
});
<div>Hello world</div>
div
{
position : absolute;
top : 200px;
left : 200px;
width : 100px;
background: lime;
}
$( function()
{
$('div').click(function(event){
alert('in div click')
event.stopPropagation();
});
$(window).click(function() {
alert('out of div click')
$('div').css('opacity', 0 )
});
});
...
stop: function( event, ui ) { alert(); div.data("stop")},
...
<div class='block'></div>
<a href='#' class='show-some'>1</a><br>
<a href='#' class='show-some'>2</a><br>
<a href='#' class='show-some'>3</a><br>
$(".show-some").click(function(){
var val = $( this ).text()
$.post('ajax.test.php',
{
val : val
},
function(data) {
$('.block').html(data);
});
});
<?php
$val = $_POST['val'];
echo $val ;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label>Выберите тип
<select id="PROD">
<option value="1000">Мини</option>
<option value="2000">Оптим</option>
<option value="3000">Макси</option>
</select>
</label>
<label>Количество: <input id="COUNT" type="number"></label>
<p>Результат: <b id="RESULT"></p>
$( function()
{
$('#PROD').bind('change', change )
$('#COUNT').bind('change', change )
});
function change()
{
var type = $( '#PROD option:selected' ).val();
var count = $( '#COUNT' ).val();
$( '#RESULT' ).text( count * type );
}
$( function()
{
$('#PROD, #COUNT').bind('change',
function() {
$( '#RESULT' ).text( $( '#PROD option:selected' ).val() * $( '#COUNT' ).val() );
})
});
if (jQuery("#header-outer").hasClass( "at-top" ))
jQuery( ".cd-popup-container" ).addClass( "menu-margin" );
while (jQuery("#header-outer").hasClass("invisible"))
jQuery( ".cd-popup-container" ).removeClass( "menu-margin" );
...
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$( function()
{
$('.input').bind( 'focus', function () {
$( this ).siblings('.input_radio').prop('checked',true)
} )
});
</script>