Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7534233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:57:30+00:00 2026-05-30T05:57:30+00:00

I am scripting a page, where a user can add text to a image.

  • 0

I am scripting a page, where a user can add text to a image. Ok and three of the elements are that:

  1. they can choose a font
  2. they can select the color of the font
  3. they can type in their own text.

The select option is:

<select id="selectafont" name="selectafont" style="width: 200px;" class="required">
 <option value="null">-- Select a Font ... --</option>
 <option value="folksbold">Folks Bold</option>
 <option value="arial">Arial</option>
 <option value="tahoma">Tahoma</option>
 <option value="verdana">Verdana</option>
 <option value="comicsans">Comic Sans</option>
 <option value="ubuntu">Ubuntu</option>

The color ( we use jscolor.com ) color picker.
Its element is:

<input id="pick_a_color" class="color" value="f12b63">

The input element and js I have working, but its a regular input element. That as you type updates the text within another div.

How do I add the value of the color ( from color ) picker and the font to the css of the DIV.

So lets say my input element is :

<input name="add_my_text" class="add_my_text" id="add_my_text" type="text" placeholder="Enter your Text...">

And the JS to control this and apend it to a div is:

$(document).ready(function () {
 //ad title
 $("#add_my_text").keyup(function() 
  {
  var add_my_text=$(this).val();
  $(".add_my_text").html(add_my_text);
  return false;
  });
 });

So that a div on page updates with the content typed in the input element.
The css of which is:

.add_my_text {
position:absolute;
left:150px;
top:40px;
font-size:18px;
 }

What I want to do is in the above div class ( dynamically change the font color and the font-family.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:57:31+00:00Added an answer on May 30, 2026 at 5:57 am

    Something like this for the font:

    $("#selectafont").change(function(){
       var font = $(this).val();
       if (font !== "null")
          $(".add_my_text").css("font-family", font);
    });
    

    And similar for the colour selection (sorry, I’m not familiar with the jscolor.com colour picker).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that has three divs one at the top, one at
Users on my site have a page they can write their own html to.
I am trying to develop a web page that will allow user to edit
I've a custom SharePoint application page in which I've different user controls (or can
I am trying to add fb-comments into my html page that is part of
A 3rd party web application has a cross-scripting security issue. There is one page
The Scripting.FileSystemObject TextStream object supports Windows style Unicode and 'plain text' modified by the
I have a textarea on my page where i allow users to write text.
I'm pretty new to php, and for that matter server scripting in general (so
I've got a C# page that's generating a PDF file and returning it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.