Showing posts with label HTML. Show all posts
How to Add Active Navigation Class Based on URL?
Ideally you output this class from the server side, but if you can't...
Let's say you have navigation like this:
HTML:
<nav>
<ul>
<li><a href="/">Home</a></li>
.
Working with Cookies in ASP.NET
Usage of Cookies in ASP.NET using C# or jQuery. A cookie is a piece of data which is sent from a website and stored locally by the user’s browser. Cookies are needed because HTTP is stateless. This means that HTTP itself has no way to keep track of.
How to Remove the white spaces at the start and end of the string?
The $.trim() function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.
<!doctype html>
<html.
How to Limit the number of characters allowed in form input text field?
By using the following attribute we can easily limit the number of characters allowed in form input text field.
maxlength="10"
Adding this attribute to your control:
<input type="text"
id="txtPhone"
name="Phone".
How to get the value of a CSS property using jQuery?
Consider the following HTML:
<div id="jjTechSol" style="height: 50px;width: 50px;">
<p>Content</p>
</div>
The following jQuery is used to get the value of a CSS property.
<script type="text/javascript">
$(document).ready(function.
How to hide the first option of a select using jQuery
When using "jquery.selectbox.js" plugin the "select & option" tags will be converted into "ul li" at run time. In this case it's hard to hide the first option using the normal select option script. The following solution rectifies this situation..
How to prevent resizing of TextArea?
We need to disable the re-sizable property of a TextArea. Normally, we can resize a TextArea by clicking on the bottom right corner of the TextArea and dragging the mouse. The following CSS is used to disable this behaviour.
Use the following CSS rule.
How to get current HTML Page Title/URL with jQuery/Javascript?
Get current HTML page Title and URL with jQuery and Javascript.
Current Page Title:
jQuery:
var title = $(document).find("title").text();
(or)
var title = $('title').text();
(or)
var title = $(document).attr('title');
Javascript:
var title.
How to find the value of a HTML tag attribute using jQuery?
Note:
When using "jquery.selectbox.js" plugin the "select & option" tags will be converted into "ul li" at run time. The problem is we can not get the selected value using the normal jQuery or Javascript when we use this plugin. The following.