By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
rocoderesrocoderes
  • Home
  • HTML & CSS
    • Login and Registration Form
    • Card Design
    • Loader
  • JavaScript
  • Python
  • Internet
  • Landing Pages
  • Tools
    • Google Drive Direct Download Link Generator
    • Word Count
  • Games
    • House Painter
Notification Show More
Latest News
How to set the dropdown value by clicking on a table row
Javascript – How to set the dropdown value by clicking on a table row
JavaScript
Attempting to increase the counter, when the object's tag exist
Javascript – Attempting to increase the counter, when the object’s tag exist
JavaScript
Cycle2 JS center active slide
Javascript – Cycle2 JS center active slide
JavaScript
Can import all THREE.js post processing modules as ES6 modules except OutputPass
Javascript – Can import all THREE.js post processing modules as ES6 modules except OutputPass
JavaScript
How to return closest match for an array in Google Sheets Appscript
Javascript – How to return closest match for an array in Google Sheets Appscript
JavaScript
Aa
Aa
rocoderesrocoderes
Search
  • Home
  • HTML & CSS
    • Login and Registration Form
    • Card Design
    • Loader
  • JavaScript
  • Python
  • Internet
  • Landing Pages
  • Tools
    • Google Drive Direct Download Link Generator
    • Word Count
  • Games
    • House Painter
Follow US
High Quality Design Resources for Free.
rocoderes > JavaScript > Javascript – Need to change text to upper case in JavaScript – createJs [closed]
JavaScript

Javascript – Need to change text to upper case in JavaScript – createJs [closed]

Admin
Last updated: 2023/12/11 at 3:51 PM
Admin
Share
2 Min Read
Need to change text to upper case in JavaScript - createJs [closed]

Problem:

Closed. This question needs debugging details. It is not currently accepting answers.


Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Contents
Problem:Solution:

Closed last month.


Improve this question

I’m new to JavaScript and I have an HTML page with JavaScript where I need to show the text in a field with text “test text tuu” to upper case. I have tried to change it so:

this.harmonicField = new cjs.Text("test text tuu", "24px 'Fort Medium'", "#FFFFFF").toUpperCase();

and also like this:

this.harmonicField = this.harmonicField.toUpperCase();

but none of the commands work. When use these commands I don’t see there anything – no text. Without the command toUpperCase()it works.

I have post it on pastebin.com (JavaScript and HTML):

  • https://pastebin.com/ybs8y4EB
  • https://pastebin.com/BuwBRVuA

How do I change the input text to upper case?

Solution:

I’ll try to answer clearly.
toUpperCase is only applied to the String it cannot be applied directly to an Object as you trying to do.
try something like this (i’m assuming you’re using createJs library):

var text = "test text tuu".toUpperCase();
this.harmonicField = new createjs.Text(text, "24px 'Fort Medium'", "#FFFFFF");

So you don’t apply toUpperCase to the object but to a string.
Also using this is always confusing but i think this could work:
this.harmonicField.text = String(this.harmonicField.text).toUpperCase();

In your case this old question from 2013 offers many good pointers in my opnion!

Related

Subscribe to Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

Share this Article
Facebook Twitter Email Print
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article How to change the input component attribute conforimng to the pinia's data vue3 Javascript – How to change the input component attribute conforimng to the pinia’s data vue3
Next Article Change the button color if the IDs in the compared arrays match (React JS Redux TypeScript AntD) Javascript – Change the button color if the IDs in the compared arrays match (React JS Redux TypeScript AntD)
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

- Advertisement -

You Might Also Like

How to set the dropdown value by clicking on a table row

Javascript – How to set the dropdown value by clicking on a table row

February 11, 2024
Attempting to increase the counter, when the object's tag exist

Javascript – Attempting to increase the counter, when the object’s tag exist

February 11, 2024
Cycle2 JS center active slide

Javascript – Cycle2 JS center active slide

February 10, 2024
Can import all THREE.js post processing modules as ES6 modules except OutputPass

Javascript – Can import all THREE.js post processing modules as ES6 modules except OutputPass

February 10, 2024
rocoderesrocoderes
Follow US

Copyright © 2022 All Right Reserved By Rocoderes

  • Home
  • About us
  • Contact us
  • Disclaimer
Join Us!

Subscribe to our newsletter and never miss our latest news, podcasts etc.

Zero spam, Unsubscribe at any time.
Welcome Back!

Sign in to your account

Lost your password?