$(document).click(function(e) {
var $target = $(e.target);
if ($target.hasClass('menu-item-search') || $target.hasClass('glyphicon-remove')) {
$('.jqeury-test-form').slideToggle(200);
} else if(!$target.parents("div").hasClass('jqeury-test-form')) {
$('.jqeury-test-form').slideUp(200)
}
});
<form id="search" method="get" action="/search">
<div class="block">
<select id="number" class="span3" name="number">
<option value="0">Выбрать</option>
<option value="1">Первый</option>
<option value="2">Второй</option>
</select>
</div>
<div class="block">
<select id="textID" class="span3" name="textID">
<option value="0">Выбрать</option>
<option value="11">Да</option>
<option value="12">Нет</option>
</select>
</div>
<button id="btn" value="Submit">ответить</button>
</form>
if($("#textID").val() == 0){
$("#btn").attr("disabled", "disabled");
}
$("#textID").on("change", function(){
if($("#textID").val() == 0){
$("#btn").attr("disabled", "disabled");
}else{
$("#btn").removeAttr("disabled");
}
$("#btn").on("click", function(){
alert('ответ');
})
})
$(document).ready(function () {
var xmlDoc = $.ajax({
type: "GET",
url: "http://www.cbr.ru/scripts/XML_daily.asp",
dataType: "xml",
success: function ( xml ) {
var xmlParse = $(xml).find('Valute');
return xmlParse;
}
});
console.log( xmlDoc);
});
function toster (){
for (i=0; i<=20; i++){
$.get('a#'+i,function(data){
$('tabe').append('<tr><td><a class="link" title="'+data.text()+'"></a></td></tr>')
})
}
}
$("tabe").on( "click", "a.link", function() {
console.log( $( this ).index() );
});