Attempting to apply the text-shadow CSS property with the help of jQuery

I am attempting to utilize the text-shadow property by taking user-supplied values and updating it using JQuery. Below is my code:

HTML Code

<td width="13%">
H-Shadow::<input id="hshadow" onchange="setShadow();"/>
</td>

<td width="13%">
V-Shadow::<input id="vshadow" onchange="setShadow();"/>
</td>

<td width="12%">
Blur::<input id="blur" onchange="setShadow();"/>
</td>

<td width="12%">
Color::<input id="shadowcolor" class="color" onchange="setShadow();"/>
</td>

My setShadow function is as shown below

function setShadow() {
var horShadow = document.getElementById('hshadow');
var verShadow = document.getElementById('vshadow');
var blurShadow = document.getElementById('blur');
var colorShadow = document.getElementById('shadowcolor');
$('.blue3d > textarea').css('textShadow', horShadow.value+"px "+verShadow.value+"px "+blurShadow.value+"px "+'#'+colorshadow.color);

}

In addition, for selecting a color, I am using the jscolor picker on the 4th input field. To enable this functionality, I have added the class "color" to the 4th input field. For more information about the jscolor picker, you can visit jsColor.

Can you help me identify where I might be making an error?

Answer №1

Why not opt for text-shadow over textShadow?

  $('.blue3d > textarea').css('text-shadow', horShadow.value+"px "+verShadow.value+"px "+blurShadow.value+"px "+'#'+colorshadow.color);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Type of element returned

Is there a way to retrieve the element type? I'm interested in applying the style of a class to HTML5 elements without using the class attribute. <!DOCTYPE> <html> <head> <title>My page</title> </head& ...

The markers from KML exported from My Maps are not showing up on the Google Maps JavaScript API

I have a map on Google My Maps that I want to showcase through the Google Maps JavaScript API. This way, I can easily merge multiple maps into one and add paths/markers without needing to code it all manually. Test out the map I'm using by clicking t ...

Inspect the properties of a ReactJS component using Playwright

I'm relatively new to end-to-end (E2E) testing. One area I am looking to test involves changing the shipping address and automatically setting it as the billing address. For example, if I input Grove Street as my shipping address, I want it to mirror ...

When trying to manually trigger the firing of the autocomplete function to get a place using Google API

My goal is to retrieve the data from autocomplete.getPlace() when triggering this event manually. Essentially, I have a function that captures the user's location in Lat/Lng format, and afterward, I aim to access other useful data using getPlace() su ...

"Using Angular's NgFor directive to efficiently organize and collapse data within

I am currently working on displaying API data in a table using ngFor, and I am facing an issue with hiding/showing a specific row of details outside the ngFor loop. Since this line is not within the ngFor loop, I am unable to bind the data accordingly. Can ...

Utilize Babel transpiling specifically for necessary Node modules

My current setup in nextjs is configured to handle ES6 code for IE11. module.exports = { poweredByHeader: false, distDir: "ssr_build", webpack(config) { config.node = { fs: "empty", net: "empty", tls: "empty" } config.plugins = config.plugi ...

Incorporate interactive click buttons into your Telegram bot

Currently working on a telegram bot using node.js with the telegram-bot API by yagop. https://github.com/yagop/node-telegram-bot-api My goal is to allow users to stop typing messages and instead just click on buttons that will trigger actions. When a user ...

What is preventing the container from occupying the full height?

Currently, I am working on creating a survey form page. I have successfully created a div with the id "container" which holds all the elements on my site. For the code snippet and reference, you can check out this link CODE * { margin: 0; padding ...

What could be the reason I am unable to view the outcome in the table? PHP rectangle area

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Area Calculation for Rectangle</title> </head> <body> <div class="container" > <form action=&qu ...

ways to display nested arrays in angularjs

I'm having an issue with binding and displaying the value of an array. When I assign the value using the scope variable like this: $scope.StockList = obj.data Everything works fine. However, when I try to push the value into the array like this $ ...

creating reactive images with Vue

The original code utilized an image in a menu as shown below: <img :alt="$t('more')" class="mobile-plus-content visible-xs" src="../../../assets/img/plus79.png" /> This results in: src="data:image/png;base64,the image" I made a mo ...

Transform the CSS animation to include a sliding down motion combined with a blur effect

Can the CSS transition be changed to allow for a sliding down effect with a blur effect? I am looking to change this CSS animation effect to match the gif image shown below. Is it achievable using JavaScript, CSS, or a combination of both? Any help in solv ...

What is the reasoning behind AngularJS's suggestion to place services, directives, and filters in their own individual modules?

Have you ever wondered why the angular-seed-project organizes filters, services, and directives into separate modules instead of keeping them all under the myApp module? angular.module('myApp', ['myApp.filters', 'myApp.services&ap ...

Achieve full height for div without causing it to expand (utilize scrollbar for overflow)

I am looking to achieve a specific layout for my webpage, as shown in the image below: The layout depicted in the image above is created using the following HTML and bootstrap classes: <div className="ContentWrapper d-flex mh-100 flex-row h-10 ...

Setting up VideoJS Flash backup

Due to Firefox's restriction on using an .mp4 file in the <video> tag, I am required to utilize the Flash fallback option on my VideoJS player. When it comes to Chrome, Safari, and IE, I can customize my VideoJS player via JavaScript to perform ...

Using a JSON web token (JWT) for authorization on a json-server

I am currently working on developing a Node.js application that utilizes typicode json-server. My goal is to implement authorization within the app, where all public users have access to GET requests, but PUT, POST, and DELETE requests require a JWT token ...

Tips on preventing the need for null or undefined checks in JS/Typescript singletons that have an initialization function

Is there a way to streamline the process of handling props in an Object literal that is dynamically initialized only once? I'm looking for a pattern that would eliminate the need for repetitive null/undefined checks and throw errors when certain metho ...

Using setTimeout in Node.js

I've been struggling to find a solution for slowing down the timeout in my code. The issue is that it runs too quickly, and I can't seem to figure out how to adjust it using Request. Everything else in the code works perfectly. var Scraper = fun ...

The Angular error TS2531 occurs when attempting to call scrollIntoView on an object that may be null

In my current Angular project, I am attempting to implement a scroll view using ViewChild by id. This is the method I have written: ngOnInit() { setTimeout(() => { if (this.router.url.includes('contact')) { ...

Switch between Fixed and Relative positions as you scroll

Just a small adjustment is needed to get it working... I need to toggle between fixed and relative positioning. JSFiddle Link $(window).on('scroll', function() { ($(window).scrollTop() > 50) ? ($('.me').addClass('fix ...