Consider following HTML snippet:

<input type="text" value="zombie"/>
<input type="submit" />
What will be the value of attribute "value" after executing following jQuery code snippet?

$('input[type="button"]').click(function(){
        $('input[type="text"]').val('human');
});
Explanation

$('input[type="text"]').val('human');
Will change the 'input[type="text"]' value.

$('input[type="text"]').atrr('value','human');
Will change the value of attribute "value"

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести