$(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() );
});
mb_substr($str, 0, 200, 'UTF-8');
$word = array();
$max_bid = array();
for ($i = 0; $i < count($rr_word); $i++) {
$word[] = $rr_word[$i]['word'];
$max_bid[] = $rr_word[$i]['max_bid'];
}
array_multisort($word, SORT_ASC, $max_bid, SORT_DESC);
$word = array_unique($word);
$result = array();
foreach ($word as $key => $value) {
$result[] = array(
'word' => $value,
'max_bid' => $max_bid[$key],
);
}
Array
(
[0] => Array
(
[word] => автомобил
[max_bid] => 46
)
[1] => Array
(
[word] => продвижен
[max_bid] => 22
)
)