skip to Main Content

Jquery – How to change language part of URL by using regex in this example?

Situation: When an id element selected, get the current URl and change the /en/ part to other language current URL http://127.0.0.1:5500/2023/en/activities_summary.html I want to change it to http://127.0.0.1:5500/2023/tc/activities_summary.html code: $('#tc').on('click',function(){ if(location.href.match(//(?:en|sc)//)){ location.replace(/^.+?/(?:en|sc)//,'tc') } })

VIEW QUESTION

Using Jquery, how to break a node into smaller nodes

I have HTML that looks like this: <table> <tbody> <tr><td><button> Split </button></td></tr> <tr><td><button> Split </button></td></tr> <tr><td><button> Split </button></td></tr> <tr><td><button> Split </button></td></tr> <tr><td><button> Split </button></td></tr> <tr><td><button> Split </button></td></tr> </tbody> </table> My program should do the following when any one of the…

VIEW QUESTION
Back To Top
Search