Saturday, 9 March 2013

Adding an Id field to an HTML element using jQuery (to help UnitTesting)

Michael just asked me to add an Html ID attribute to help him with the UnitTesting of teamMentor:

image

So I changed the function forgotPasswordResponse method from:

image

to (note the new jQuery method):

image 

and now the Div that holds that text has an ID that Michael can use

image

we can also confirm that the Div is there by using $(”#emailSentMessage”) on the Chrome’s console:

image

and we can change it’s value using $("#emailSentMessage").html("A new message")

image