In HTML I use <b>...</b> to make parts of a text bold.
<h1 class = "Style-MyText">This text is normal. <b>This text is
bold.</b></h1>
Now I'd like to do the same with a JavaScript.
I tried
HTML: <h1 id = "MyID1" class = "Style-MyText">.</h1>
javascript: document.getElementById("MyID1").firstChild.replaceData(0,
document.getElementById("MyID1").firstChild.nodeValue.length, "This text is
normal. <b>This text is bold.</b>");
Unfortunately <b>...</b> is displayed as '<b>' and '</b>' and not
interpreted to make the text bold.
'View Selection Source' shows: This text is normal. </b>This text is
bold.</b>
Is there a way to make some parts of a text bold with a JavaScript?
I'm creating a simple memory game in which the user has to make pairs from cards. I would like the user to see the variable "trys" (the score) update on the page dynamically (in a text box would be great). I can do this by showing a msgbox every time try increments but this is annoying to use. I have been trying for hours to get this to work, using innerhtml. Code:
I recently added some javascript code to my website to make the current date update automatically. It displays as centered. I would like to know how I can align the date to the left. Also, how to change the date text to bold , and how to change the fonts of the date text.
here i m developing one text area along with bold/italic/uppercase/lowercase options using java script. i m getting bold and italic but i m not getting uppercase letters and lower case letters.
my code:function upper() { document.getElementById("text").toUpperCase(); } function lower() { dcument.getElementById("text").toLowerCase();}
I have the cycle plugin running, works fine on all but IE7 (not catering to IE6). The pager elements on the right do not appear in IE7. I have tried adjusting the z-index, etc., but can't figure it out.
Also, the caption text transitions in with bolded elements properly appearing, and then they flip to regular text (the whole line of text transitions a bit strangely).
I am trying to use javascript code so that on loading of a webpage, the page displays the day, date, month and year words. So far I have come up with the following but it doesnt seem to be working: Code:
I have a Java-based web application whose interface can be in multiple languages. My requirement is that the javascript alerts that I display should be displayed in the language in which the interface has been generated. The interface language is dynamically loaded and the text is displayed using Java's <fmttags.
How can I make the Javascript alerts, etc. also change their display language dynamically? Is it possible in Javascript or do I have to use another technology to do the same?
I'm trying to get each of the if statements below in a text text box with the result depending on the answer of the equation. However i can't figure out a way to allow the user to click a button to to show the result in a text box.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE>
I want to display the date 19/06/2007 in this format.I want to validate the number entered in the textbox i.e for first digit of date it should not accept more than 3 (accept only 0,1,2,3). When the text length reaches 3 & 5 ie after date & month, by default this function should return slash ( / ) - this is to avoid typing / from keyboard. I don't have any idea to do this.
I have added the function below, which I will be calling onkeypress event.
OnKeyPress="javascript:valNumber(this.value);" function valNumber(value) {
var x=value.length; if(x==0 && (event.keyCode==48||event.keyCode==49||event.keyCode==50||event.keyCode==51)) event.returnValue=true;
What i want to do is: as soon as a txt box (name of txt box is 17) is populated with a date, I want to automatically display the Gregorian version of that date in GrDate2 text box.
Here is the site (you can check out the source code there). [url]
The GrDate2 txtbox displays nothing. I have checked with Jquery experts and the jquery code is correct and should work. The only thing I can think of is it has to do with Javascript or Html.
I've got the images now, the sizes, and even the title and description from the metadata.The images run in the window on my page, and all that is working fine.....NOW I'd like to display the title of the image either ON or UNDER the image as it displays. The images are running from a javascript script, and I HAVE the title available to the javascript (it, like everything else, is in a two dimensional array the javascript is using)...In my rummaging around I found this:
What I want to do is on the blog's main html page is to have the whole story printed. On other html pages, I want only the first 100 characters of the story to be printed, as a summary of the story. One way would be to manually count the 100 characters, copy the text, and paste it into all the html pages I want the summary to show. (Too much work). Or I figured I could use script to do it for me. Would Javascript be the best way to do this? Would I store the blog text in an external .js file and assign a variable to it (such as var x="blog story text") and call upon the variable to display the full text on the blog story html page? And then in the external .js file, run a procedure that counts the first 100 characters and stores it in another variable, then call upon this other variable in the .html files where the summary is printed? If so, since there would be many blog stories, would I create an external .js file for each blog story, since the javascrpt file would become to big and slow down loading time?
I have a simple website with 2 Frames,In top frame I have a button that invokes CGI script and internally that CGI script prints info (text) into the bottom frame.Going further we want to print the output coming from CGI into a textarea object in bottom form.
I have a function in my CGI script:But ends up printing multiple textarea objects in lower frame.We want to print each line of text into the same textarea object in lower frame. and at the end display a new button.How can we do this using javascript/CGI?I tried the following but not displaying anything.
sub print_message { my($message1, $message2) = @_; my $final_message = $message1 . " " . $message2;
For instance I want to display some announcements from an external text file on a predefined box, like lets say 140 wide and height scalable according to text. The texts would be some announcements from me, a few words. I want the text justified and with previous / next link, if possible. And when they navigate to another page, they will get a random message in that box. There are news tickers on the net, but I just want something simple like this, no scrolling, fading, etc..
how to display the texts form my main html form to another html form?....since i didnt know how to hide the textboxes and select list for printing the html form... my plan is that
im gonna pass all the displayed data from my main html form to another html form which has a print button there.. so that when i print only the text (the html elements like buttons and txtbox will "not" be included)..
a clearer explanation ( i have a textbox on my main html form then i displayed it on the other page)
[this is a textbox]-----------------> this is a textbox <---im gonna print this w/o the box
I am having trouble adding to my option box, I want to add the name "Angie" to my select list and display it in the text box as well using a new function. I am not sure what the proper code is to do this. The rest of my program is working with no errors. Is there a form that shows how to do this? Below is my code the part I am having trouble with says add your name and should work with button b5 on click.
I want to create a webpage that has a grid of 8 images displayed on the left side of the page. All the images are "dimmed" by default and when the user moves their mouse over an image, it lightens to its normal state. What I want to do is when they hover the mouse over an image, display a chunk of text in thearea to theright of the image grid. Essentially, the images act as a kind of menu and when the mouse hovers I want some details to be displayed. Ideally, I want to format the text to make it look good - so am not sure if it would be better to create an image containing my text and display this image when the mouse hovers.
I'm using the script below in a custom HTML to generate a random line of text (not with the text shown here). This works fine BUT; I want it to go randomly through the WHOLE list without repeating lines that already have been printed. As it is now, a line of text might be printed several times in a row, which is a little annoying. I'm using a refresh button for generating a new line of text.
How can I just make it display in the order shown and just re-arrange the content so it seems random to the user? Random would the best though...
<script language="JavaScript"> <!-- var r_text = new Array (); r_text[0] = "All the leaves are brown";
If I set $Message = 'hello' then it works and the message is inputed onto the rich text editor and appears. But when I try to retrieve the variable via $Message = $_SESSION['Message'] or from a database $Message = $INFO['Message'] ... the whole text editor disappears! How do I keep the data in the rich text editor from disappearing after a refresh by storing the variable with javascript or something else.
I have a horizontal image scroller which I have downloaded from the following site:
[URL]
The actual scroller works fine however when I hover over the images, the alt text isn't displaying.I'm not very good with javascript, but I have set it as per the code displayed and it's just not working.
I have a document list of several hundred drug names where some are lower case and some are all caps. I want to bold only the lower case drug names but don't want to do it manually. Is there a java script that I can apply where it automatically does that for me?