I have the below html element.And i want to apply the src value it has for the attribute data-val-required to another element's(id='Title2') src property.
<input id="Title" name="Title" type="text" data-val-required="<img class='validateicon'
src='https://mysprt/Content/Images/16x16-red-alert.png'/><font color='Red'>*</font> Required" >
I tried the below and it works but i want to know if there is a better approach than this ?
javascript:alert($($('#Title').attr('data-val-required')).attr('src'));