473,480 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to call an image with javascript and send if off?

1 New Member
I am trying to call an img in html and send if off but I can't seem to figure out where I am going wrong. I am sending it off to a <textarea>. (still new at java script)

Here is my HTML
Expand|Select|Wrap|Line Numbers
  1.  <div id="buttonWrapper"> <div id="button01"> <img id="buttonImage" src="http://bytes.com/imges/font01.png" alt="button01"> </div> <div id="textArea"> <div id="instruction"> <p> *Type a word here, and click diffrent styles and sizes</p> </div> <div id="textSpot" > <textarea name="word">
  2.  
  3.  
  4.  
  5. Here is my javascript
  6.  
  7.  
  8.     function init(){
  9.         document.querySelectorAll("#buttonImage").onclick = changeFont;
  10.  
  11.  
  12.  
  13.     function changeFont(){
  14.         document.querySelectorAll("word").style.fontFamily = "'Oswald', sans-serif";    
  15.     }
  16.  
  17. }
Jan 19 '15 #1
1 1152
Dormilich
8,658 Recognized Expert Moderator Expert
1) querySelectorAll() returns a NodeList/HTMLCollection, not an HTMLElement (even if there is only one element in the match) on which the defined properties would make sense.

2) "word" is an invalid HTML element.

what you want is querySelector().
Jan 19 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1667
by: Roberto Gallo | last post by:
Hi everyone; * How can I actively call a Javascript function from inside a Applet? * What would be a good messaging system among some Applets inside the same page? Thank you very much....
4
3151
by: dennise9 | last post by:
My exeternal JS works fine when the call is placed in the page head or body. But if I call the same javascript from a (clicked) text link on the page, the script throws a JS error when it...
0
1585
by: Petra | last post by:
Hello! I'm developing my first website with ASP. Now I seached the hole internet for a answer, but nobody seems to have the same problems as I am: I like to refresh a frame from another...
5
2568
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
5
9838
by: moni | last post by:
Hi.. I am trying to use javascript for google maps display. If I call the javascript function from my aspx file I use: <input type="text" id="addresstext" value="Huntington Avenue,...
2
4673
by: tarinip | last post by:
Hi, How to call a javascript method from XAML. I am using C# . In the following example, When I click button1, I wish to call a method by name "SetValue(somevalue)" of TestIndex.html file....
0
1177
by: querry | last post by:
Hi all, I have a little problem. I want to call a javascript function from a link buttons event handler. How can I do that. What I am trying to do is this.... In the code behind file of my...
1
1820
by: thirunavukarasukm | last post by:
I have a link wich opens a the second page with links wich call a javascript function. I have some problem with javascript. i am two aspx page.. in my first aspx page contain the second...
1
1687
by: jmohan | last post by:
Hi everyone, I am developing a website using asp.net with C#. And I developed a toolbar using javascript like google and yahoo toolbar which is placed in the browser separately. Toolbar has...
0
2370
by: AmitSuri | last post by:
Hi Everyone, I am new in Bytes. I am making an J2ME application in which user will be able to capture image and send it to Sql Server or Web Server. I have created an application in which i allow...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
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
7076
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
5321
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,...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
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...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.