Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Change some word in text

We can change picture in the client side, which mean, when we move the mouse to it, it will change other picture. I am trying to find a way to change the text. Like this. I put "Point me!!!!" in page. When the mouse point to it,It will change to "Yes, You Point Me!!!, Now click Me!!!". Like this. Thank you.

Comments

  • StPatrickStPatrick Member Posts: 76
    Create a script and function in it:
    [code]
    function changeText(text, obj){
    obj.replaceChild(document.createTextNode(text), obj.childNodes[0]);
    }
    [/code]

    Then add the element you want to work on, for example P element:
    [code]

    Point me!

    [/code]

    [b][italic]Philip Patrick[/italic][/b]
    [b]Home page[/b]: http://www.saintopatrick.com
    [size=1][italic]"Two beer or not two beer?"[/italic] [b]Shakesbeer[/b][/size]

  • jeffy_khorjeffy_khor Member Posts: 163
    I think I can see the code, but I have 2 question to ask.
    1) Can it replace with VBScript as I don't know much about JavaScript.
    2) Where to download a JavaScript E-Book(0-5MB, I see some ebook up to 100MB ;-0).
    Thank You.

    : Create a script and function in it:
    : [code]
    : function changeText(text, obj){
    : obj.replaceChild(document.createTextNode(text), obj.childNodes[0]);
    : }
    : [/code]
    :
    : Then add the element you want to work on, for example P element:
    : [code]
    :

    Point me!

    : [/code]
    :
    : [b][italic]Philip Patrick[/italic][/b]
    : [b]Home page[/b]: http://www.saintopatrick.com
    : [size=1][italic]"Two beer or not two beer?"[/italic] [b]Shakesbeer[/b][/size]
    :
    :

  • StPatrickStPatrick Member Posts: 76
    Well, yes, you can replace it with VBScript, but remember that only IE is working with VBScript on client side. So better not to do it.

    I dunno where you can find a book, but you can look at http://www.w3schools.com for reference and quick tutorials

    : I think I can see the code, but I have 2 question to ask.
    : 1) Can it replace with VBScript as I don't know much about JavaScript.
    : 2) Where to download a JavaScript E-Book(0-5MB, I see some ebook up to 100MB ;-0).
    : Thank You.


    [b][italic]Philip Patrick[/italic][/b]
    [b]Home page[/b]: http://www.saintopatrick.com
    [size=1][italic]"Two beer or not two beer?"[/italic] [b]Shakesbeer[/b][/size]

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    ______ // http://forcoder.org // free ebooks and video tutorials about | PL/SQL, Ruby, Perl, Delphi, C#, Scratch, Objective-C, Visual Basic .NET, Swift, MATLAB, C, Go, Python, Java, JavaScript, PHP, Visual Basic, Assembly, C++, R ABAP, Erlang, Transact-SQL, F#, Lisp, Fortran, Scheme, Logo, ML, Kotlin, Lua, Prolog, Rust, Dart, Awk, Hack, Apex, LabVIEW, FoxPro, Crystal, Julia, VBScript, COBOL, Ada, Alice, Bash, Scala, SAS, Clojure, D | _

Sign In or Register to comment.