user2965100
user2965100

Reputation: 29

Dynamically change some part of URL with JS

I have HTML code

 <img src="YP.jpg" width="100%" height="auto" onclick="location.href =&#39;phonepe://pay?pn=Phonepe Pvt Ltd&amp;pa=ktb.xkhemkaryt05322@icici&amp;tn=Order&amp;am=200&#39;;">

And I want to convert specific part of URL by just converting the letters to uppercase in a series.

"ktb.xkhemkaryt05322" This is the part which I want to dynamically change (Just uppercase in a series, like uppercase 1 letter at a time only)

I am not a developer but I am struggling to be one. Anyone kind enough to provide me a solution?

Upvotes: 0

Views: 470

Answers (1)

Asif
Asif

Reputation: 397

Dynamic url assaign into this (dynamicUrl) variabel

Example:

var dynamicUrl = "/terget/url"

<img src="YP.jpg" width="100%" height="auto" onclick="location.href =&#39;phonepe://pay?pn=Phonepe Pvt Ltd&amp;pa=${dynamicUrl}">

Upvotes: 1

Related Questions