While writing code in jQuery, I often use .text() method to get the content of any element from DOM. This function is straight forward, it strips off all the html element from a selected element and returns the remaining text.So for below element the .text() method will return "A quick brown fox".<div id="foo"> A quick brown fox </div> <script> $("#foo").text(); ...
Have you ever used textarea in your UI design to get text from user? (Ofcourse you must) :) You must have specified rows and cols attribute to define the height and width of the textarea, or by using CSS. By whatever mean you create your textarea, the width and height of the textarea is fixed. What ...
Autocomplete is a common feature available in lot of web tools and services. You will find lots of implementation of autocomplete features. Let us see how can we implement a simple Autocomplete feature for Country names in Java-JSP and jQuery.We will use
jQuery's autocomplete plugin for our example. I have used Eclipse for the development of this demo.Create a dymanic web project ...
Tagging the content has increased the searchability of content in todays Web 2.0 world. Also similar content can be grouped together by assigning them same tags.Tag Cloud has became a good way of displaying the weighted tags in a manner easy to understand and search. You can find a lot of code written in all ...
Maxlength of Textarea Setting up maxlength of input text are easy. Just an attribute maxlength="##" does the work. But maxlength attribute does not work with textarea. I tried writing <textarea rows="5" cols="30" maxlength="120"></textarea> but this does not works.So what to do if we want to fix the maxlength of a textarea?Use following jQuery plugin for setting maxlength of any textarea on your page.First thing for ...