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()
- }
- }
-
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions01ForumsTop experts
Arun PottiAnswers in the forums20answers02
Tahir AnsariAnswers in the forums5answers03
Kamlesh KumarAnswers in the forums5answers04
Sam HobbsAnswers in the forums4answers05
Željko PerićAnswers in the forums3answersFull leaderboard →
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Joginder BangerRank #360 · 7K reputationPosted Feb 5, 2020, 10:52 PM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Feb 5, 2020, 11:02 PM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Feb 5, 2020, 11:07 PM EST