Solved

Jquery Label In-line Style Not Working?

Posted on 2014-07-30
6
161 Views
Last Modified: 2014-07-30
I'm trying to change part of the Label html like so. Problem: font is still bold

<label id="caption">New image name: (optional)</label>
$("#caption").html("Image saved as: " + "<br/> <style=\"font-weight: normal\">" + data + "</style>");
0
Comment
Question by:WorknHardr
6 Comments
 
LVL 13

Expert Comment

by:duncanb7
Comment Utility
Is it what your want, pls try this
Duncan
<label id="caption">New image name: (optional)</label>
$("#caption").css("font-weight","normal");

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
What is the point of the style tag? That won't do anything

$("#caption").html("Image saved as:<br/>" + data);
0
 
LVL 21

Accepted Solution

by:
Randy Poole earned 300 total points
Comment Utility
$("#caption").html("Image saved as:" + "<br/> <span style='font-weight: normal'>" + data + "</span>");

Open in new window

0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Closing Comment

by:WorknHardr
Comment Utility
duncanb7: Thanks, I need only certain text changed, not the entire text

Gary: You shouldn't post a criticism without a solution!

Randy Poole: Excellent! Just what I needed, thx
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Do you understand what a question is?
0
 

Author Comment

by:WorknHardr
Comment Utility
Drop it!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now