473,412 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Way(s) to change text?

I know it is easy to change text styles, fonts etc., using JS, as for
example below:

<div id="example">Text text text</div>

<script...
document.getElementById("example").style.fontSize= "110%";
</script>

But what way(s) exist to change the actual text itself? Eg. dynamically
change the string "Text text text" to "Bla bla bla" ?
Jul 21 '05 #1
2 3405
michael <no****@example.com> wrote:
I know it is easy to change text styles, fonts etc., using JS, as for
example below:

<div id="example">Text text text</div>

<script...
document.getElementById("example").style.fontSize= "110%";
</script>

But what way(s) exist to change the actual text itself? Eg.
dynamically
change the string "Text text text" to "Bla bla bla" ?


First, this is not a Javascript newsgroup, this is a stylesheets
newsgroup. You'd do better asking this in an appropriate group.

Second, CSS is not used to alter the content. It's role is to style
the content. Your above script would be so much easier and more
reliable to do like this:

<style type="text/css">
#example{font-size:100%;}
</style>
Jul 21 '05 #2
> newsgroup. You'd do better asking this in an appropriate group.

Note taken! have done.
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Boris ©avc | last post by:
What would be the optimum code for replacing string "xxx" with "yyyyyyy" in a file? (maybe with str_replace function?) Thanks, Boris Savc
2
by: JR | last post by:
Hi. I have a CGI script that will need to call itself an unknown number of times, to add rows, run queries, etc. At the bottom of the output that is produced by the script, there are four...
4
by: michael | last post by:
I have an html text string within a div, eg.: <div id="example">Text text text</div> I know its easy to change styles by using getElementById - for example: ...
6
by: Michael | last post by:
I have a simple situation, where I have a textbox (myTextBox) which represents the value of say an integer (myInt). Now, whenever I change the value of myTextBox, I would like myInt to be updated....
2
by: Steve Richter | last post by:
I am spending too much time thinking of nesting tables within tables to get the form layout that I want. a simple example: Sub heading: property text: entry field property text: entry...
43
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
3
by: Ryan Liu | last post by:
Hi, I want to change keywords text color in a text editor. I select RichTextBox and use its Select() method to select keywords line by line, one by one, then change its color. ...
4
by: ldpfrog | last post by:
This is my first tutorial, so if there are any mistakes please forgive me =). This will show you a very simple way to read your Login information from an outside text file. What you need: 1....
14
by: Patrick A | last post by:
All, I have an Access DB. On a nightly basis, I want to look at an Other DB (not Access, but SQL) and: + Add any new records from Other.Clients into Access.Clients Is this something I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.