the document onClick event.

Hello

If I have a following HTML document and I want to be able to fire an alert to the user when he clicks on ANY case of the document other than any of the paragraphs (e.g. of the < div id = "firstParID" > < / div >, < div id = "secondParID" > < / div >, < div id = "thirdParID" > < / div >), how achieve only through an onclick event in javascript?

< html >
< head >
My Document HTML < /title > < title >
< / head >

< body >

< div id = "firstParID" > This is my first paragraph... < / div >
< br > < br >
< div id = "secondParID" > This is my second paragraph... < / div >
< br > < br >
< div id = "thirdParID" > This is my third paragraph... < / div >
< br > < br >
< font size = "2" color = "Blue" > rest of information goes here... < / make >

< / body >
< / html >

Thanks in advance!

Quote:
Posted by: newsgroup user
just google 'javascript disable left click' and you'll end up with a
Horde of examples...
--

Azadi,

You will not understand me, but anyway, the code is very simple. Just put a ' onclick = alert ("' you clicked on the document.") "in the body tag.

Thanks a lot anyway!

Tags: ColdFusion

Similar Questions

  • dynamically set the onclick event in setAttribute with bbui

    Hello

    what I want to achieve is to create an onclick event in a ListItem which is passing a variable to the function of bb.pushScreen (). I have it?

    1. after a loading screen, I created a dynamic list with items that have an onclick event.

    listItem = document.createElement('div');
    listItem.setAttribute('data-bb-type', 'item');
    listItem.setAttribute('data-bb-title', title);
    listItem.setAttribute('data-bb-accent-text', combindedDate);
    listItem.setAttribute('onclick', "bb.pushScreen('page.htm', 'page', '666');");
    

    2. If clicked article opens a new page, because of the onclick attribute. (works well)

    The additional option (666) must be a variable. I couldn't understand how to solve this problem.
    There must be a way I can pass a variable in the new created element the bb.pushScreen funtion.

    Any ideas?

    The best

    bert2002

    UPDATE: just sitting once again and its possible some flee:

    listItem.setAttribute('onclick', 'bb.pushScreen(\'page.htm\', \'page\', \''+ itemid +'\');');
    

    chadtatro wrote:

    Just helped a friend with the same thing yesterday, it was also a problem of leaks... the "update" sounds good to me, it's good now?

    Yes absolutely is working very well

  • [C++] Events to detect changes to text in the document

    Hi all

    I use C++ to develop a plugin for InDesign. During development, I want to catch the events of changing text in the document open in InDesign. The events are something like adding or deleting certain characters or words or phrases in the document. Those can be understand that the events occurred when the user change or remove the text in the document.

    When the events are detected, they should provide what characters, words or phrases are added or removed from the document. In addition, they should provide the index of the text changes if they are able to do.

    Please help me with this problem by providing methods, functions or libraries can detect changes to text in InDesign.

    Sincerely,

    Tri Dung

    Hi Tri Dung,

    Check the API TextPreProcessService and TextPostProcessService. You can write your own services and implement the interfaces ITextCommandPreProcess and ITextCommandPostProcess.

    Markus

  • Hang the function call after Document Class' Event.ADDED

    I tried to load an external SWF (which contains the code below in its document class) with the charger of class but I keep getting Error #1009: cannot access a property or method of a null object reference. So I tried to use the Event.ADDED event listener in the constructor of MyDocumentClass of the external SWF file to leave the document class to be part of the display list, before I have to call createRandomGraph. But when I place createRandomGraph() inside onStageReady, the compilation process is suspended. When I left the createRandomGraph() inside the constructor, it works perfectly as isolated but will produce error 1009 so loaded in the SWF loader. Any ideas?

    public void MyDocumentClass)

    {

    this.addEventListener (Event.ADDED, onStageReady);

    createRandomGraph ( )

    }

    private void onStageReady(oEvent:Event): void

    {

    this.removeEventListener (Event.ADDED, onStageReady);

    }

    private void createRandomGraph(): void

    {

    var cRandomGraph:RandomGraph = new RandomGraph();

    cRandomGraph.x = 10;

    cRandomGraph.y = stage.stageHeight - nH - 25;

    cRandomGraph.setDimensions (nW, nH);

    cRandomGraph.createGraphBackground ();

    this.addChild (cRandomGraph);

    }

    use:

    public void MyDocumentClass)

    {

    this.addEventListener (Event.ADDED_TO_STAGE, onStageReady);

    }

    private void onStageReady(oEvent:Event): void

    {

    this.removeEventListener (Event.ADDED, onStageReady);

    createRandomGraph();

    }

    private void createRandomGraph(): void

    {

    var cRandomGraph:RandomGraph = new RandomGraph();

    cRandomGraph.x = 10;

    cRandomGraph.y = stage.stageHeight - nH - 25;

    cRandomGraph.setDimensions (nW, nH);

    cRandomGraph.createGraphBackground ();

    this.addChild (cRandomGraph);

    }

  • Rank Selector - how to set the onclick event handler?

    I have a set of master-detail forms and would like to respond to the onclick event of the line selector. When I go on the line selector column attributes I don't see anywhere to set the onclick event.

    The other elements of tabular presentation have a field 'Attributes of the element' that I use usually, but not line selector. I just missing something?

    I'm open to alternatives as well. The reality is, however, I do not need anything either complicated or sophisticated. When the user clicks on the box I collect data from the current row and initiate an AJAX call. I have to submit the page, etc.

    Thank you

    Brent

    I think the only way to do this is to use the package apex_item like this:

    http://HTMLDB.Oracle.com/pls/OTN/f?p=31517:170

    Standard line selector is not an option to fix the JavaScript to it.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • BUG: OS6 / JavaScript 'onclick' event when pulling ball control to help

    Hello

    I'm developing a web application targeting OS6 devices (torch and no key, for example Curve 9300). The problem is that an 'onclick' event does not fire when you use a Trackball to click on the object (torch and Curve 9300).

    It seems to be a bug (browser) OS6 as an "onmouseover" works without problem.

    ......
    
    var submitButton = document.getElementById('submit-button');submitButton.onclick = testOnClick;
    
    function testOnClick() {    alert('onclick never gets triggered by trackball, but when you touch the button it does!');}
    

    This causes a problem deploying the application to a mixed environment of OS6 devices.

    Someone else has a similar problem, or miss me something?

    Thank you

    Hi Sasha,

    I tried the code on the following simulators below:

    Torch 9800: 6.0.0.227, 6.0.0.246, 6.0.0.337

    Style 9670: 6.0.0.309

    NOTE: I couldn't find a simulator of 9300 with 6.0

    This code, everything seems to work properly on those built using the trackpad to move the pointer over the button and click it.

    Are maybe run you document.getElementById () in a script page that is not related to a document loaded event online?  I wonder if the purpose of the document is not yet loaded until you take a reference to it?

    
    
        
            
            Untitled Page
            
        
        
            
        
    
    
  • Defining a button to a function not defined onclick event / custom

    I'm not a developer of captivate, but I develop a page that is embedded in an iframe (webobject) within a page of captivate. Page that I have developed a chart, the data for which depend on which button is clicked in the Captivate parent page.

    Ideally, I wish I could have my captivate developer simply set the onclick event for each button to call a function (by name) I'll set my page in the iframe. To do this, I was hoping there was an option to simply give the name of the function to an event onclick in captivate, so that my iframe can 'reach' in the parent company and equal to a function in my graphic page, I set the value of this function.

    I would like most, the outcome to be (basically) something like this:

    Captivate page:

    < someButton onclick = "CaptivateTest1" >

    < someButton2 onclick = "CaptivateTest2" >

    < iframe src = "myGraph.html > < / iframe >"

    myGraph.html:

    < html >

    <!--... Graph of stuff here->

    < script >

    function myDefinedFunction() {}

    Change a chart of the data

    }

    function myOtherDefinedFunction() {}

    Change a chart of the data

    }

    window.parent.CaptivateTest1 = myDefinedFunction;

    window.parent.CaptivateTest2 = myOtherDefinedFunction;

    < /script >

    < / html >

    Describe your functions in the html document in the iFrame:

    window.parent.CaptivateTest1 = function()

    {

    do stuff

    }

    Then you have Developer run JavaScript in JS linked to the button window:

    CaptivateTest1();

  • How to detect changes in the document?

    Dear friends and experts,

    It seems obvious that, with my new project , I opened Pandora's box...

    Pallets to remain open, even when you set a new location of cursor, so I use this to my dialogue.

    But the user can also switch to another document when the palette is open.

    Currently I have a Refresh button, and the user is prompted to use after the passage of another document. The function behind is to analyse the newly entered document and define global variables to update the dialog.

    How I detect the switch of the document? I did find something like onDocumentChange.

    (In the current script a check for the name of the modified document is in the function btnRefresh.onClick to avoid irrelevant work).

    Thank you for all the ideas.

    Klaus

    Hi Klaus,

    This version of your script works fine:

    Just remove some "var" in winPal - dialogue.

    Delete "winPal.show ()" in the Notify function

    give a little more space to st1.

       #target framemaker
        Notification (Constants.FA_Note_PostActiveDocChange, true);
        var globalValue = app.ActiveDoc.Name;
        var winPal = new Window ("palette", "Simple Palette", undefined);  
    
        SimplePalette (globalValue);  
    
        function SimplePalette (outerParm) {
           innerParm = "none";
           buttonOuter = winPal.add ("button", undefined, "Outer");
           buttonInner = winPal.add ("button", undefined, "Inner");
           st0 = winPal.add ("statictext", undefined, "st= " + innerParm);
           st0.preferredSize.width = 300;
           st1 = winPal.add ("statictext", undefined, "Button clicked: " + innerParm);
          st1.preferredSize.width = 300;
          buttonOuter.onClick = function () {
            st1.text = "Button clicked: Outer";
          }  
    
          buttonInner.onClick = function () {
            st1.text = "Button clicked: Inner";
            st0.text = outerParm;                                // this changes the display
          }  
    
          winPal.show ();
        }  
    
        function Notify (note, object, sparam, iparam) {
        // Handle the event triggered after the active document changes.
        $.bp(true);  // here was a type : $.br(true)
          switch (note) {
            case Constants.FA_Note_PostActiveDocChange:
                {
              // Update your dialog box here.
              st1.text = "Current document is " + object.Name ;
              break;
              }
          }
        }
    
  • Disappearance of the sets of documents the Documents SharePoint 2010/2013

    Hello

    Please, can someone help me explain why more than 5000 documents disappeared from the sets of different documents in a single day. I have more than 5000 sets of documents on my SharePoint Portal with an uncountable number of customer documents in them. No reason to SharePoint, documents disappeared from each document or events together, leaving the document sets empty.

    Please, your technical advice would be really appreciated.

    Thank you.

    Hi Christian,

    Your question is more complex than what is generally answered in the Microsoft Answers forums. The question you have posted is related to SharePoint and would be better suited to the TechNet community. Please post your question in the TechNet forum. Check out the following link.
    http://social.technet.Microsoft.com/forums/Office/en-us/home?category=SharePoint

    Please do not hesitate to contact us if you have other questions related to Windows.

  • Cancel the registration of events does not not to change value

    Cancel the registration of events does not seem to prevent the change in value of firing event.

    I've attached an example of change that disables the mouse enter and exit events to include the value Change event.

    Document ID 4ATCBP1U

    http://digital.NI.com/public.nsf/allkb/E3E5E1B3021D8EFA8625730A0062F52D

    You use the standard event, not the dynamic one (note that the Boolean value does not have the <> ).

  • I have trouble getting documents to print. My printer shows but is not printed and I have problems to open the documents. What should I do?

    My printer will print a demo and report, but freezes when I try to print a document or any other task. Most of the time when I try to open a document he invites me to open or save and when I select open it momentarily off and then immediately prompts you to open or save again. It does again and again and never opens. When I select record it indicates that the file already exists. I tried to unplug the computer and the printer and restart their but the problem persists. What can I do?

    Hello, Jsraine,

    To rule out malicious software, restart your computer and start typing the F8 key.  Select Mode safe mode with networking.  Disable the system restore where the malware is known to hide.  Re-activate when you are finished.

    How to turn on and off on system restore in Windows XP

    http://support.Microsoft.com/kb/310405

    Download the following tool and run a scan complete

    http://www.Microsoft.com/security/PC-Security/Malware-removal.aspx

    When you're finished, restart Windows

    Start > type CMD

    Click on CMD and type sfc/scannow

    Press enter

    Note: There is a space between sfc and / scannow

    When you are finished, while remaining in the CMD window, type chkdsk /f /r

    Press enter

    You will see a message about the volume must be locked and you want to monitor during the recovery?

    Press y and press enter

    Restart the computer for the scan at startup

    When you are finished, you will find the results in Event Viewer > Windows Logs > application log

    Look for Winninet to see the results

    Start > type Services.msc

    Press enter

    Scroll down to print spooler

    Click with the right button on spooler and select stop

    Wait for Windows to stop the spooler

    Window close services

    Start > Control Panel > printers folder

    Right-click on the printer, and then select open

    You see all pending print jobs?

    Click the printer menu, and then select Cancel all Documents

    Close printers folder

    Start > right click on computer

    Select manage

    Select Device Manager in the left index

    Click on the + sign next to the IEEE... compatible printer

    Right-click on the printer and select uninstall

    Click on the + sign next to imaging devices

    Right-click on the printer and select uninstall

    Click on the + sign next to Bus USB controllers

    Right-click on the printer and select uninstall

    Close Device Manager

    Restart the computer

    Windows will reinstall drivers on reboot

    Go to the manufacturer's website and search for updated drivers

    Open the Services window

    Scroll down to print spooler

    Click with the right button on spooler

    Select restart

    Wait for Windows to start the spooler

    Close the Services window when you are finished

    Try printing again

  • Windows Explorer (Vista) hangs when I try to access the Documents folder on a network computer running Windows 7

    Simply run the Windows Explorer on my Vista (desktop computer) machine and try to view or otherwise access My Documents directory on my Windows 7 computer crashes Windows Explorer (computers are connected at home).  Messages event viewer the following:

    Failing application Explorer.EXE, version 6.0.6002.18005, time stamp 0x49e02a1e, failed module ntdll.dll, version 6.0.6002.18327, time stamp 0x4cb74dd3, exception 0xc0000374, offset error 0x00000000000aca57, process 0xb64 id code, start the application time 0x01cc0fa1b28a295d.

    I tried several things to cure the problem without success.  My last attempt was to create a new directory on the Vista computer on the Windows 7 computer.  I then copied some files (using the Windows 7 machine) from the Documents directory on your Windows 7 computer to the new directory and was able to access it from the Vista computer.  I transferred then all the files in the Documents directory to the new directory (again on the Windows 7 computer).  Then, I deleted the Documents directory and renamed the new directory of Documents.  However, when I try to access the Documents directory on the Windows 7 computer from the Vista computer, explore crashes as before (see more top job Event Viewer).  Windows 7 computer is currently running Windows 7 Home Premium, and SP1 is installed as are all Windows updates.  I am able to access the directories music, Photos and videos on the Windows 7 computer from the Vista computer.

    Hello

     

    You can perform a scan of the SFC (System File Checker). It lists all the issues and will also retrieve all files if necessary. Follow the steps below to p Ed a SFC Scan -.

    a. click Start, click programs, on Accessoriesprincipally made, right click guestand then click run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click Allow
    b. type the following command and press ENTER:
    sfc/scannow
    A message appears indicating that "the system scan will start. Be patient because the scan can take some time.
    c. If all files require a SFC replace will replace them. You may be asked to insert your Win7 DVD for this process to continue.
    d. If everything is correct you should, after the scan, see the following message "resource protection Windows not found any breach of integrity".
    e. once the scan is finished, close the command prompt window, restart the computer and check.

    See the link for further directions on scan SFC - below
    http://support.Microsoft.com/kb/929833

    I hope this helps.

  • "Error - a problem prevented the document under analysis. Please try again, or to correct this information, see Help and Support or the documentation that came with the scanner"while trying to scan using HP G4050 on windows 7

    A problem prevented the document are analyzed. Windows 7 - HP G4050 scanner.
    I have a HP G4050 which worked fine with Vista.  After the upgrade to Windows 7, I get the following error when scanning:

    A problem prevented the document are analyzed.  Please try again, or to correct this information, see Help and Support or the documentation that came with the scanner.

    I get a different error during an attempt of an overview.  It starts to get an overview of the page, gets about 2 inches to the bottom of the page and then I get the following error:

    An error occurred when you set the properties of the scanner.  If another program is scanning, please wait to complete, and then try again.

    I downloaded the latest driver (and reinstalled several times) of HP with no luck.  No errors are recorded in the Application events.

    I'm going nuts trying to figure out this one!  Thanks for your help.

    BT

    Update:

    I finally had time to unplug the scanner, wait 60 seconds and then plug it again.

    Problem solved.

    Scan of stupid...

    BT

  • Is it possible to listen to the exit app event in webworks?

    Dear all,

    Is it possible to listen to the exit app event in webworks?

    What I would do is:

    Displays a warning message (told that notification feature will be disabled) to the user when they attempt to close the application.

    I saw resume, pause events in the document here: https://developer.blackberry.com/html5/apis/v2_0/blackberry.app.html

    And look for exit the event on playbook, bbos: blackberry. app.event. onExit )

    But found no output Earphone for BB10.

    Could you please provide any valuable resource or information about it?

    Thanks for the help.

    Unfortunately the platform as a whole does not have to "suspend" the process of application endpoints. Even if we hung out at the event, the web runtime is being demolished before that you could do something meaningful.

    Sorry I don't have better news.

  • Not pulling HTML onClick event!

    Hey guys,.

    I use the onClick event that is not shot. I tested Simulator v4.5. How to make clickable HTML buttons without using the onClick event?

    Hi Vinayak,

    Can you confirm if JavaScript is enabled? Selection 'Options' in the menu of the browser and make sure the "Enable JavaScript" box is checked.

    Also, how you set your HTML button, as a

Maybe you are looking for

  • Save all the data for a while loop

    I already asked a similar question, but it is perhaps not very clear, and there are a few concepts that I did not understand. 1. I have a keyboard to generate flow DTMF signal (I call it stream because it contains several shades that consist of a ful

  • ENVY dv7: Formatting Windows 10

    Saxemard HO a PC con Windows 8.1 operating system. Ho intended di installare Windows 10. Since money periodically delle formattazioni by the following del mio computer, I wanted to know is dopo sommergibili di Windows 10, to formatto dovro'usare REED

  • My GT5481E can connect to my TV using HDMI?

    SDMI PORT ON IT 7550331 RE: Windows Vista model GT5481E S/N CGM75 610 00085 This model is available to connect to the TV with an HDMI cable? Or how to connect to them. I wouldn't find HDMI outport on the rear panel of the pc or no possibility to add

  • Can you make a password reset disk to another computer.

    Problems with my password and did not have reset disk.

  • Volume control turns itself higher

    I'm new to Vista.  Here's the problem: suddenly pops up a blue window with a counter of volume and the speaker and the computer volume caps.  If I open the volume control and move the slider to a lower level of the volume, the volume goes up.  Finall