Немного полагаясь на ответы других людей. Теперь позволяя Вам определить файл Вы хотите читать из и переменная, в которую Вы хотите результат, помещенный:
@echo off
for /f "delims=" %%x in (%2) do (
set %1=%%x
exit /b
)
Это означает, что можно использовать вышеупомянутое как это (предположение, что Вы назвали его getline.bat)
c:\> dir > test-file
c:\> getline variable test-file
c:\> set variable
variable= Volume in drive C has no label.
assuming #selectall
is a checkbox itself whose state you want copied to all the other checkboxes?
$(function () {
$('#selectall').click(function () {
$('#friendslist input:checkbox').attr('checked', $(this).attr('checked'));
});
});
You may try this:
$(function () {
$('#selectall').click(function () {
$('#friendslist input:checkbox').attr('checked', checked_status);
});
});
//checked_status=true/false -as the case may be, or set it via a variable
Итак, "проверено" - дерьмовый атрибут; во многих браузерах это работает не так, как ожидалось :-( Попробуйте сделать:
$('#friendslist').find(':checkbox')
.attr('checked', this.checked)
.attr('defaultChecked', this.checked);
Я знаю, что установка defaultChecked не имеет никакого смысла, но попробуйте и посмотрите, поможет ли.
maybe try this:
$(function () {
$('#selectall').click(function () {
$('#friendslist .tf').attr('checked', this.checked);
});
});
Use the jquery toggle function. Then you can also perform whatever other changes you may want to do along with those changes... such as changing the value of the button to say "check all" or "uncheck all".
$(function () {
$('#selectall').toggle(
function() {
$('#friendslist .tf').attr('checked', 'checked');
},
function() {
$('#friendslist .tf').attr('checked', '');
}
);
});
У меня это работает (IE, Safari, Firefox), просто изменив this.checked на «checked».
$(function() {
$('#selectall').click(function() {
$('#friendslist').find(':checkbox').attr('checked', 'checked');
});
});
$('#friendslist .tf')
this selector will suit your needs