Is it possible to use ID tag to change css content
Is there a way on taking the ID's from html ex) id="title1" so it takes whats in it to display in the content: section in the css.
<table class="layout display responsive-table">
<thead>
<tr>
<th class="th" id="title1">Title12</th>
<th class="th">Title2</th>
<th class="th">Title3</th>
<th class="th">Title4</th>
</tr>
</thead>
table.responsive-table td:nth-child(1):before {
content: use id here;
}
table.responsive-table td:nth-child(2):before {
content: 'Title 2';
}
2Answer
Yes using the attr() function.
table.responsive-table td:nth-child(1):before {
content: attr(id);
}
https://developer.mozilla.org/en-US/docs/Web/CSS/attr
- answered 8 years ago
- Sandy Hook
Yes you can take this via jquery. Just try
$(document).ready(function(){
$("#title1").text();
})
- answered 8 years ago
- Sandy Hook
Your Answer