Need to get TAG name by element name using Jquery [duplicate]

This question already has an answer here:

I have set of html elements and I named those for all input/select/textarea. Anyway the names are unique for each element.

Now I need to get the Html TAG (Input/Select/Textarea) by Element name.

For EX:


I need to get the ‘input’ TAG by using element name ‘sample’.

I dont want to mention the TAG name on selector part in jquery. I have only unique names to find the TAGs.

Please help on this.

Thanks in advance.!

How to get Process Finish Button event in Dynamics CRM?

I am using Dynamics 365 online instance to integrate sales process. I have one condition where I need to change the Probability field value to 100 when user clicks on Finish button in Close Process Stage.

enter image description here

I have done some research and found that (OnProcessStatusChange event) can help to get business process flow status change (statuses: Active, Finished, or Aborted)

Ref Link: OnProcessStatusChangeEvent

I have checked this by adding this to form OnLoad event like below, but nothing happens.

Xrm.Page.data.process.addOnProcessStatusChange(setProbablityOnFinish);

Is there any other solution?

How can I tell if user is moving to next or previous stage of business process flow when OnStageChange event is fired in Dynamic 365 Online?

I’m writing a JS script to intercept and do some additional validations when user moved to the next stage of business process flow in Dynamic 365 Online.

I’m binding my function to OnStageChange event of Dynamic 365, but that event is not only fired when a user moved to next stage but also when he moved back to previous stage as well.

Is the any way to tell if the user is moving to the next or the previous stage?