TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
277.8k
using jquery on angular 7 not working and not make red to di
Feb 6 2020 3:36 AM
problem
using jquery on angular 7 not working and not make red to different rows ?
I using jquery on angular 7 but when using this jquery code not working
import
{ Component, OnInit } from
'@angular/core'
;
import
* as $ from
'jquery'
;
@Component({
selector:
'app-root'
,
templateUrl:
'./app.component.html'
,
styleUrls: [
'./app.component.css'
]
})
export
class
AppComponent
implements
OnInit {
title =
'TestIndexSolution'
;
constructor() {
// Called first time before the ngOnInit()
}
ngOnInit() {
$(
function
() {
$(
"#table1"
).find(
"tr"
).each(
function
() {
var
tds = $(
this
).find(
"td"
);
var
value = tds.eq(0).text();
tds.each(
function
() {
if
(
this
.innerText != value) {
tds.css(
"color"
,
"red"
);
return
false
;
}
}
)
}
)
})
// Called after the constructor and called after the first ngOnChanges()
}
}
<html>
<head>
<script src=
"Scripts/jquery-3.3.1.min.js"
>script>
<head>
<body>
<table border=
"1"
>
<col width=
"500"
>
<col width=
"500"
>
<col width=
"500"
>
<col width=
"500"
>
<tr bgcolor=
"#6699FF"
width=
"100%"
>
<th>Part1</th>
<th>Part2</th>
<th>Part3</th>
<th>Part4</th>
<tr>
<td>12</td>
<td>12</td>
<td>12</td>
<td>12</td>
</tr>
<tr>
<td>12</td>
<td>15</td>
<td>12</td>
<td>12</td>
</tr>
<tr>
<td>17</td>
<td>15</td>
<td>12</td>
<td>12</td>
</tr>
</table>
</body>
</html>
Reply
Answers (
3
)
How to display count green color if value > 0 and red if < ?
Error TS2339: property ‘rows’ does not exist on type ‘htmlel