adsense

Wednesday, February 27, 2019

CSS Accessing Elements using data attributes

When selecting elements in CSS, normally we user ID or class to select them. We can use data attribute in an element to select an element as shown below.

HTML

<div data-somename>
  Hi
</div>

CSS
[data-somename] {
color: red;
font-style: underline;

}

Cheers,
Samitha

Friday, February 15, 2019

read only radio input

A radio button can be easily disabled using "return false" on click as shown below.


<input type="radio" id="rbOptions" checked="checked" onclick="return false;"/>

Cheers
Samitha