I would like to re positioning the <em>
tag in label field using jQuery
From: <label><em>*</em> Name</label>
To: <label>Name <em>*</em></label>
Also check the label contain <em>
tag or not?
Thanks in advance.
JSFiddle> http://jsfiddle.net/74gP2/
$('label em').remove();
$('label').append('<em>*</em>');
Try,
var contents = $('label').contents();
var len = contents.length;
$('label').prepend(contents[len-1]);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.