Logo Mark L. Reyes
Check html element for inline CSS

Check html element for inline CSS

September 11, 2013
1 min read
		/**
		*	Check all div elements for inline CSS display block.
		*	Should output 'Do stuff.' if display block is true.
		*	Requires jQuery to leverage: $ alias and .css() method
		*/
		if (($('div').css('display') == 'block')) {
			console.log('Do stuff.');
		}

		/**
		*	Select div element(s) with inline CSS display block.
		*	Should return div element(s) if executed in dev console.
		*	Requires jQuery to leverage: $ alias
		*/
		$('div[style="display: block;"]');

Thanks to: Stackoverflow and jsfiddle