Dear All
Help me to resolve this
I have two fields
i want to use this as follow
if some text is entered in name (input) ... say 2/3
on blur
I split this and i want to display
2/
3
2 as superscipt divided sign or / sign and 3 as subscript as defined in JQUERY
JQUEY
- $("#name").blur(function () {
- var name= $('#name').val();
-
- var substr = name.split('/');
- var mstring= "<sup>"+substr[0]+"</sup>"+"/<sub>"+substr[1]+"</sub>";
- $('#container').append(mstring); // displays 2/3 in div whose id is container
- $('#detail').append(mstring); // displayed / (Only slash in textarea whereas i want to display 2/3 )
- });
html
- <input name="name" type="text" id="name" value="<?php echo $rows['name']; ?>" size="50" />
- <textarea name="detail" cols="50" rows="4" id="detail"><?php echo $rows['detail']; ?></textarea>
- <div align="left" id="container" bgcolor="#336699"></div>