HTML Script for Placing Text |
HTML Script for Placing Text |
Tom G |
Apr 20 2019, 03:44 PM
Post
#1
|
Group: Members Posts: 1 Joined: 20-April 19 Member No.: 26,883 |
Hey.... is there basic html script to allow the following?:
In our church app, we can use basic html. What I am trying to do, is have the user type within a "fill in the blank" field, but I want what they typed to also appear way down the page in another paragraph, targeting a specific spot in a sentence in the paragraph down the page. I need to get this done today if it's possible. It's for our Easter service tomorrow. Our pastor just had this idea... hence the urgency! Thanks for any input!! Tom |
Christian J |
Apr 21 2019, 03:47 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,673 Joined: 10-August 06 Member No.: 7 |
Do you want to allow anyone to write on the page, and do you want the result to be saved and stay visible to any visitor? Then you need a server-side script (like PHP), and it's not a quick task.
But if you only want each user to see the result in his own browser, you can do it relatively fast with java script: CODE <p> <input type="text" id="foo" value="" placeholder="Type your text here"> <input type="button" id="bar" value="View changes"> </p> ... <p>Some text <span id="baz"></span> more text.</p> <script type="text/javascript"> window.addEventListener('DOMContentLoaded', function(){ var foo=document.getElementById('foo'); var bar=document.getElementById('bar'); var baz=document.getElementById('baz'); bar.onclick=function() { baz.textContent=foo.value; } }); </script> |
Lo-Fi Version | Time is now: 26th May 2024 - 08:42 PM |