Programming Tips - jQuery: get first child

Date: 2020apr17 Platform: web Language: javaScript Library: jQuery Q. jQuery: get first child A. Use children() to get all children and then first to reduce it to only the first:
var numberOne = $('#mything').children().first();
For example to make all children red then the first green:
$('#mything').children().css('background-color', 'red'); $('#mything').children().first().css('background-color', 'green');