Articles on Trending Technologies

Technical articles with clear explanations and examples

How to make a textarea and input type read only using jQuery?

Kristi Castro
Kristi Castro
Updated on 13-Mar-2026 3K+ Views

To make a textarea and input type read only, use the attr() method or the prop() method in jQuery. This prevents users from editing the content while still allowing the elements to be focused and their values to be submitted with the form. Using the attr() Method For readonly, set the input type text and textarea as read only using the attr() method as shown below − $('input[type="text"], textarea').each(function(){ $(this).attr('readonly', 'readonly'); }); The readonly attribute prevents users from modifying the content of form elements while still allowing them to be ...

Read More

How can I show and hide div on mouse click using jQuery?

David Meador
David Meador
Updated on 13-Mar-2026 20K+ Views

To show and hide div on mouse click using jQuery, use the toggle() method. On mouse click, the div is visible and on again clicking the div, it hides. The toggle() method is a convenient jQuery function that automatically switches between showing and hiding elements. When an element is visible, toggle() will hide it, and when it's hidden, toggle() will show it. Example Here's a complete example that demonstrates how to show and hide a div on mouse click − ...

Read More

How to disable/enable an input box with jQuery?

Arnab Chakraborty
Arnab Chakraborty
Updated on 13-Mar-2026 18K+ Views

We can easily disable input boxes (textbox, textarea) using the disabled attribute. When an input element is disabled, users cannot interact with it, and it won't be included in form submissions. To disable an input element − $('elementname').attr('disabled', 'disabled'); To enable a disabled element, we need to remove the "disabled" attribute from the element − $('elementname').removeAttr('disabled'); Alternative Methods jQuery also provides the prop() method which is recommended for boolean attributes like disabled − // To disable $('elementname').prop('disabled', true); // To enable $('elementname').prop('disabled', false); Example Here's a complete example demonstrating how to disable and enable ...

Read More

Sorting an already sorted internal table in ABAP

radhakrishna
radhakrishna
Updated on 13-Mar-2026 2K+ Views

When working with internal tables in ABAP, sorting performance can be optimized by understanding how sorting affects subsequent operations. If you leave the second sort operation, it would be quicker as the internal table (itab) will already be in the right order. Sorting and Binary Search Example Consider the following example where we sort by multiple fields and then perform binary searches − SORT itab BY f1 f2 f3. READ TABLE itab WITH KEY f1 = 'A' f2 = 'B' ...

Read More

Moving TABKEY from CDPOS table into field structure in ABAP

mkotla
mkotla
Updated on 13-Mar-2026 639 Views

When working with change documents in ABAP, you may need to move the TABKEY from the CDPOS table into a field structure. I would suggest you make use of Function Module CHANGEDOCU_KEY_ANY2CHAR and other function modules of function group SCD8. This function module performs the reverse function of converting change document keys. Using CHANGEDOCU_KEY_ANY2CHAR Function Module The primary function module for this task has the following details − Function Module: CHANGEDOCU_KEY_ANY2CHAR Function Group: SCD8 ...

Read More

How to disable/ enable checkbox with jQuery?

Kristi Castro
Kristi Castro
Updated on 13-Mar-2026 6K+ Views

To disable and enable checkbox, use the attr() method. Initially set the input type checkbox and disable it − Male Now on the click of a button, toggle between disabled and enabled checkbox − $("#button1").click(function() { $("#sName").attr('disabled', !$("#sName").attr('disabled')); }); Example Here's a complete working example that demonstrates how to toggle checkbox state using jQuery − ...

Read More

How to add easing effect to your animation with jQuery?

Ricky Barnes
Ricky Barnes
Updated on 13-Mar-2026 671 Views

To add easing effect to your animation, use the animation speed properly to form it a perfect animation for the web page. Do not speed up animation and you should know where to stop it while using animate(). jQuery provides several built-in easing options like "swing" and "linear", or you can use custom easing functions for more advanced effects. The key is to control the timing and smoothness of your animations. Here for our example, we have a button that takes you to a textarea to add an answer − Add ...

Read More

How can I make jQuery animations smoother?

Kristi Castro
Kristi Castro
Updated on 13-Mar-2026 700 Views

To make jQuery animations smoother, use the easing library and set appropriate animation speeds to create perfect animations for your web page. Avoid speeding up animations excessively and know when to stop them while using animate(). The easing library provides various transition effects like swing, linear, easeIn, and easeOut that make animations appear more natural and polished. Key Tips for Smoother Animations Here are essential techniques to improve jQuery animation quality − Use proper timing: Choose appropriate duration values (fast, slow, or milliseconds) Chain animations: Link multiple ...

Read More

How to animate a change in background color using jQuery on mouseover?

Kristi Castro
Kristi Castro
Updated on 13-Mar-2026 860 Views

To change background color with animation, use the mouseenter and mouseleave events. The background color changes smoothly when you place the mouse cursor over an element using jQuery's animate() method. For basic color change without animation, you can use the css() method − mouseenter: function(){ $(this).css("background-color", "gray"); } However, to create smooth animated transitions, jQuery's animate() method provides better visual effects. The mouse cursor interaction is applied to the following element − Move the mouse pointer to animate the background color change. Example You can try ...

Read More

How animate(), hide and show elements using jQuery?

David Meador
David Meador
Updated on 13-Mar-2026 4K+ Views

jQuery provides powerful methods to animate, hide and show elements with smooth visual effects. You can use the animate() method combined with hide() and show() methods to create dynamic animations that enhance user experience. animate() Method The animate() method allows you to create custom animations by gradually changing CSS properties. When combined with hide() and show() methods as callback functions, you can create smooth transition effects. Syntax $(selector).animate({properties}, speed, callback); Example Here's a complete example showing how to animate elements before hiding and showing them − ...

Read More
Showing 1–10 of 61,259 articles
« Prev 1 2 3 4 5 6126 Next »
Advertisements