It looks like the way you did is exactly what I said.
In addition to IE, if you would like to run jQuery on the other browsers via UiPath, you may consider using the custom activity, “JqueryExecution.Activities”
Please refer to the previous post below.