Web Demo Mobile Demo Angular Demo Vue Demo React Demo

TextBox with Icons

Click the icons on textbox to perform actions.

Select Icon Align:
<!DOCTYPE html>
	<meta charset="UTF-8">
	<title>TextBox with Icons - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
	<h2>TextBox with Icons</h2>
	<p>Click the icons on textbox to perform actions.</p>
	<div style="margin:20px 0 40px 0;"></div>
    <div style="margin:10px 0 20px 0">
        <span>Select Icon Align: </span>
        <select onchange="$('#tt').textbox({iconAlign:this.value})">
            <option value="right">Right</option>
            <option value="left">Left</option>
	<input id="tt" class="easyui-textbox" style="width:400px" data-options="
			prompt: 'Input something here!',
			iconWidth: 22,
			icons: [{
				handler: function(e){
					$(e.data.target).textbox('setValue', 'Something added!');
				handler: function(e){
				handler: function(e){
					var v = $(e.data.target).textbox('getValue');
					alert('The inputed value is ' + (v ? v : 'empty'));