Voorgrond
Achtergrond
Stel kleur in
Voorbeeld tekst
$(document).ready(function () {
$("#btnKnop1").on('click', function () {
if ($('#txtElement3').is(':checked')) {
var txtElement = $('#txtElement').val()
$('#divResult').css('color', txtElement)
} if ($('txtelement2').is(':checked')) {
var txtElement = $('#txtElement').val()
$('#divResult').css('background-color', txtElement)
}
})
})
I tried this, at first it did work, now it doesn't work anymore.
How to change the div color, and background color when radio button is checked and on button click?
$(document).ready(function () { $("#btnKnop1").on('click', function () { if ($('#txtElement3').is(':checked')) { var txtElement = $('#txtElement').val() $('#divResult').css('color', txtElement) } if ($('txtelement2').is(':checked')) { var txtElement = $('#txtElement').val() $('#divResult').css('background-color', txtElement) } }) })
[/code] I tried this, at first it did work, now it doesn't work anymore. How to change the div color, and background color when radio button is checked and on button click?
Когда я нажимаю на «Карточку», цвет иногда меняется, а иногда нет. Часто случается, что изменившийся цвет не сохраняется. Я хочу создать что-то вроде страницы уведомлений Facebook, где мы узнаем об уведомлениях о прочтении по измененному цвету...