Javascript examples for jQuery:Form Text Input
Remove specific text from textbox while keeping the remaining text intact
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js"></script> <script type="text/javascript"> $(window).load(function(){//from w w w.j ava2 s . c om $("#fullName").blur(function() { var values = $(this).val().split('/'); $(this).val(values[values.length - 1]) }); }); </script> </head> <body> <input type="text" id="fullName" value="Hello/test"> </body> </html>