Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 months ago.
Improve this question
I am unable to create comments. I tried using // and */ but it's still showing the comments as normal text. I am using visual studio code as IDE
You are working with .html file, hence should use HTML comments if you are displaying contents into the web.
<!-- this is html comment -->
If you are using JavaScript, then use
/* js comment here */
or just
// js comment here
for one-line comments.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I have a html page with <html> tag where I want to add dir="rtl" and lang="ar" attributes using jQuery when user click on arabic language in drop-down.
I tried using $(html).attr("dir","rtl")
But it returns undefined. Can somebody help as I'm new to jQuery
There is an error on your code, the "html" tag should be written with quotes as folows:
$('html').attr("dir","rtl")
Ok, the question is closed, answer given, so no use for this answer anymore.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
Well, I know this question has been asked before a few times but I'm just a beginner and still couldn't solve it.
I want to set the minimum date of the input date picker to today. In many answers I found the datepicker() method but my webstorm doesn't know this method.
my code:
$("#date").datepicker("option","minDate", new Date(2020,6,5) );
Any tipps for me? Thanks a lot.
Without thinking much about it, it's most likely because you didn't include jQuery UI. datepicker() is a jQuery UI only method.
https://jqueryui.com/
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm trying to select a class inside div.
my code:
<div id="cool" style="width: 80%;height: 80%;margin: auto;">
cool
</div>
Selector:
$('#cool .redirect').attr('href', google.com);
it does not work. Please suggest.
I'm a beginner and just started to learn jquery!
Your code works for me once I correct your attempt to use google.com (that is, the value of the field named com in the nonexistent variable google). Put quotation marks around the string and it works fine.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I'm trying out jQueryUI for the first time, and I'm trying to use the draggable function, for a div as follows:
$("#draggable").draggable();
However If I refer to the google hosted jQuery API, it doesn't seem to work :
script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"
But if I download and use a local copy of the library, it works :
script src="jquery-ui.min.js"
Am I missing something?
I noticed that the problem was not the hosted api. I was referencing the jquery.min.js file after referencing the jquery-ui.min.js. When I corrected the order, it worked. I guess jquery-ui.min.js was using assets from the jquery.min.js library, and was erroring out when it couldn't find a reference to it.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 years ago.
Improve this question
I have created the javascript based demonstration and now I want to hide an image on click in certain condition only.
$("#clear").click(function(){
if ($('#image').is(":visible") && ('#image2').is("hidden")) {
$("#image").hide();
};
});
As you can see my code is not right, so I want to know how to format my code properly. I couldn't find the right way to write multiple conditions in one string. Thanks in advance.
The problem is that you forget to add $ (jQuery) to your second condition and selector hidden is incorrect, should be :hidden:
if ($('#image').is(":visible") && $('#image2').is(":hidden"))