Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <th>
- <select id="fcity" onchange="return change();">
- <option value="">Все города</option>
- </select>
- </th>
- <td class="city">{$item.city}</td>
- /*подготовить фильтр по городам*/
- var supervise = {};
- $(".city").each(function() {
- var txt = $(this).text();
- if (supervise[txt]){
- //$(this).remove();
- }else{
- ($('#fcity').append('<option value="'+txt+'">'+txt+'</option>'))
- supervise[txt] = true;
- };
- });
- function change(){
- op=$( "#fcity option:selected" ).val();
- if(op=='')$(".city").parent().show();
- else{
- $(".city").each(function() {
- if($(this).text()==op)$(this).parent().show();
- else $(this).parent().hide();
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement