There is no such a "getElementsByClass" function in javascript,
then how does jQuery manage to do that?
Looping all elements will be too less efficient.
BTW,how to specify css to elements with two or more classes?
<a class="one two">test</a>
Guessing like below?
.one.two {...}
Is that right?
...
$(this).parent().next().css('display','none');
The above only hides the sibling right next to the current one.
If there are multiple ones,will fail.
...
<a id="test" class="target1 target2">test</test>
How to know whether $("#test") has applied .target2 or not?
...
Hi,
I am having some trouble with some code I am trying to implement. Any help would be much appreciated.
In a database table I have 2 fields:
postcode
area
Every postcode is related to an area.
On a HTML form I have an input field. Users enter their postcode into this field.
My question: what is the best/safest/easiest method, w...
I want to add some Ajax sorting options to a list. Since my site runs without JavaScript thus far I'd like to keep it running for people with it turned off, old/mobile browsers or noscript.
How can I run a block of JavaScript when clicking a link if JavaScript is enabled and have that link direct the browser to a new page if it's not. I...
I have the following HTML:
<div id="similar-products" class="box small">
<div class="product">
<h3><a href="#">Lorem ipsum 1</a></h3>
<p class="figure"><img src="_img/thumb/blah.png" alt=""></p>
<p class="price">€ 19,99</p>
<p class="more-info"><a href="#more-info">More info</a></p>
<p class="add-to-cart"><a href="#add">Add t...
I have the following repeating pattern of tables and buttons
----------------------
table 1 .inventory class
----------------------
[button 1 .add-row]
----------------------
table 2 .inventory class
----------------------
[button 2 .add-row]
----------------------
table 3 .inventory class
----------------------
[button 3 .add-row]
...
IE8 can go into IE7 mode if it needs to. How does jQuery detect this? Specifically, what is the value of $.browser.version?
...
Hi,
Can someone suggest good learning materials or websites to learn JavaScript and jQuery? Am pretty new to this and want to learn right from basics.
Thanks in advance,
Geetha
...
I'm trying to create an accordion type menu using the following JQUERY:
function initMenu() {
$('#menu ul').hide();
$('#menu li a').click(
function() {
$(this).next().slideToggle('normal');
$(this).css("background", "url(customnav_selected.png) top right");
}
);
}
$(document).ready(function() {initMenu();});
This wo...
A couple of questions actually,
Given that the following two will return the same result set
$("#MyTable tr");
$("tr", "#MyTable");
is there any difference in performance between using the Parent-Child CSS selector convention or specifying a context to the selector instead?
Also, given that I can guarantee a tr will be an immediate ...
I've got the following piece of code that shows a popup and then hides it after a short period of time:
div.stop()
.animate({top:'0px'},{queue:true,duration:this._speed})
.animate({opacity: 1.0}, {queue:true,duration:this._delay})
.animate({top:'-' + outer + 'px'},{queue:true,duration:this._speed,complete:this._myFunction});
Whe...
This code should work in IE (don't even test it in Firefox), but it doesn't.
What I want is to display the name of the attached file. Any help?
<html>
<head>
<title>example</title>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript">
$(document).ready( function(){
...
hi all,
how are you? now i am working with jq treegrid? it work fine with xml but when i use json then error showing in jquery.base.js as
init is not defined
[Break on this error] init(ts);
grid.base.js (line 1137)
i can not overcome this. what is the problem??????
please any one can help me
...
I have a link appended to a div element. And on clicking the link, I want a function to be executed.In order to check if the function is called, when I click the link, i had an alert box in that function. But no alert box is appearing if I click the link?
This is the link added to the div element 'fb_contentarea_col2top'.
$("<p class='...
Probably a simple question but I need to add a link to the text as below and I am not sure how to do it
callBack: function(me) {
$(me).text('All done! This is my link to google!').css('color','#090');
}
...
I have a small problem, I want to load data from a PHP file and put them on a DIV.
Here's the Jquery code
// Store the username in a variable
var jq_username = $("#txt_checkuser").val();
// Prepare the link variable
var link = 'user.php?action=check&username=' + jq_username;
$('div #checkuser_hint').load(link);
So it works! but i...
I try to load a php file called summary.template.hp when the content in class profi is clicked and
load changepass.template.php when the content of class changepass is clicked.
There is no problem in loading in firefox. But in Internet Explorer 7 the summary.template.php file is loading but the changepass.template.php file is not loadi...
How do I identify empty textboxes using jQuery? I would like to do it using selectors if it is at all possible. Also, I must select on id since in the real code where I want to use this I don't want to select all text inputs.
In my following two code examples the first one accurately displays the value typed into the textbox "txt2" by t...
Does anyone know how to stop a page from reloading or navigating away?
jQuery(function($) {
/* global on unload notification */
warning = true;
if(warning) {
$(window).bind("unload", function() {
if (confirm("Do you want to leave this page") == true) {
//they pressed OK
alert('ok');
} else ...