Search code examples
htmlappendcontains

Why jquery not working on this page but it works on other Normal pages


I have this jquery that can detect the sentence and add the span on it

https://cognitive-assessment.iwi.unisg.dev/submission/?mode=preview&token=c5e77101c559cd672654248f52d5692a

this is the page where i want to run jquery

you have to login to view the page

Username:ABC paswword:ABC@@99

jQuery(document).ready(function( $ ){
  
$("h5:contains('Medium Overall Feasibility of Use Case')").html(function(_, html) {
   return html.replace(/(Medium Overall Feasibility of Use Case)/g, '<yellow class="yellow">$1</yellow>');
});

});

This is the jQuery that need to run...


Solution

  • The jQuery snippet you shared works on my side for the page you shared. As a proof of concept, take a look at the following screenshot:

    enter image description here

    What are the other pages you are referring to ? What exactly doesn't work when you run this code at your side ?

    Note: It's always a bad idea to publicly share the credentials of your university account, for security reasons.