Skip to content

Tag: text

Changing the text after clicking a button in a modal

May I know how to solve my problem, how will it work if you click the button then the confirm button then the text “Hello” will change to a “Hi” word? I tried my best to solve it but I still can not know how to figure my problem that is why I am asking for a help. https://jsfiddle.net/…

Setting the position of a text geometry?

I have looked through stack overflow and google and I have found how to CENTER a text geometry but that is not what I want to do. I have a scene that just has a block of text that says “Buy Here!”. Using the documentation in the three.js website and examples here I was able to do that after some

How do I make text bold after the user clicks a button?

I am trying to make a text editor in JavaScript and it has various features like bolding the text and italics and some others. When the user clicks on any one of them, then anything that they have selected will become edited accordingly. Now I am able to get the selected text and even put strong tags before a…

Add text to SVG path dynamically

I have an SVG exported from Adobe Illustrator with several paths like this, which produces a small polygon I intend to use as a text box I’d like to dynamically add text to it. I’ve seen many similar questions here, but most of them involed specifying a x and y property for a text element based on…

How to remove spaces from a string using JavaScript?

How to remove spaces in a string? For instance: Input: Output: Answer This? Example Update: Based on this question, this: is a better solution. It produces the same result, but it does it faster. The Regex s is the regex for “whitespace”, and g is the “global” flag, meaning match ALL s…

Scale and move a text smoothly with javascript

I’m having a text scaled and moved via JavaScript / jQuery. I can’t use jQuerys animate() because it has to fade in and out and has to be repeated and with more elements (end result: “flying” from the background, moving in different directions and fading out). My problem: It’s no…