Skip to content
Advertisement

Tag: jquery

why jQuery functions don’t work together?

I’m new to jQuery, my functions adds class active to buttons when different inputs have value. However, only one function out of two works at once. Both functions work just fine separately. Maybe I am missing something? I writing these functions directly on html file without document.ready, but it didn’t solve the issue. Is there a way to make both

How to let JS code allow both input and textarea

I have some JS code that will turn my code bold, italicized, or underlined with user input, so if the user checks bold the text will be bolded. Here is the code: It is giving me an error, and it is not bolding/italicized/underlined. I think this is because the JS code is checking for input, but the tag is textarea.

Disable or enable only the current button

With a PHP for each cycle, I’m bringing articles from the database. In those articles, we have a comment section with a form. I want to check with jQuery if there is something written on the input before the comment is sent. As the articles are being brought with a PHP cycle, I want to check only the article in

Loading text from a file in JavaScript

I have created a function to get text from a file using an url. The function uses $.get() of jQuery to fetch the file. The function works fine but the problem here is $.get() is asynchronous so the order of the output is not predictable i tried changing it to synchronous but it freezes the page completely i have tried

Hide and show images on hover

Hide and show images on hover. Class artists-main has artists names and class artists-image has images of the artists. It’s working fine but my code is lengthy. I have round about 50+ artists and page will be filled by jQuery code. I want to shorten it. Answer use same class name

How can I fill the inside of a SVG?

I am trying to fill a heart shape SVG on click using html, css and javascript, but it doesn’t seem to work. Here is the svg code : I have tried multiple solutions, such as using “fill” in CSS which only fills the stroke around the svg, but also removing everything in the path from the second M which only

Undefined error even though variable is declared

I am trying to create a card where all information are stored. However after I created the variable and tried to append text to it, I got an undefined error. What should I change? Here’s the error: Uncaught TypeError: title is undefined createCards http://localhost/Projects/diary/:86 createCards http://localhost/Projects/diary/:75 success http://localhost/Projects/diary/:103 jQuery 6 http://localhost/Projects/diary/:96 jQuery 13 diary:86:13 createCards http://localhost/Projects/diary/:86 forEach self-hosted:206 createCards http://localhost/Projects/diary/:75

Advertisement