Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8376253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:23:12+00:00 2026-06-09T15:23:12+00:00

This function is supposed to hide the patient note and show the next note

  • 0

This function is supposed to hide the patient note and show the next note (if they have another note)

function nextNote(idno){
    document.getElementById(idno).style.display = 'none';
    var idno2 = parseInt(idno)+1;
    document.getElementById(idno2.toString()).style.display = 'inline';
    document.getElementById('prevNote').label = parseInt(document.getElementById('prevNote').label) + 1;
    document.getElementById('nextNote').label = parseInt(document.getElementById('nextNote').label) + 1;

Uncaught TypeError: Cannot read property ‘style’ of null at "document.getElementById(idno).style.display = 'none';

The element in question
<li class="notes" label="1052" style="display: inline;" id="1">On: 5/17/2004 A real good Patient test</li>

nextNote is being called by: <input type="button" id="nextNote" class="notesbottombutton" value=">" label="1" onclick="nextNote(this.label);" />

If I use the Chrome javascript console
document.getElementById(1).style.display; I get: "inline"

Note I will add checks to the function after I get it work such as if(document.getElementById(idno2.toString()) so that it doesn’t do anything if there are no more notes to display, I am just trying to get the basic functionality first

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:23:13+00:00Added an answer on June 9, 2026 at 3:23 pm

    Maybe the problem is your click handler:

    nextNote(this.label);
    

    label is not a property of HTML inputs. It’s not even a valid attribute. To set the caption of an input with type="button", you should use its value attribute and use this.value to access it.

    If you’re just using this attribute to attach data to the element and want to access the attribute, you should do it like this:

    nextNote(this.getAttribute('label'));
    

    But I’d recommended that you use a data- prefixed attribute instead, the standard way to attach data in HTML 5 (it’s also backwards compatible):

    <input data-label="foo" />
    
    nextNote(this.getAttribute('data-label'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small jQuery script: $('.field').blur(function() { $(this).next().children().hide(); }); The children that is
Suppose I have this html markup: <div id=wrapper> <pre class=highlight> $(function(){ // hide all
I have this function which is supposed to set a certain time format to
I've had trouble writing this code. I'm supposed to make a function that can
Suppose I have this function: void my_test() { A a1 = A_factory_func(); A a2(A_factory_func());
Suppose I have a utility function like this - public static boolean isABlankSpace(char c)
Suppose I have a function like this (I use akka 2.0.2): def foo(message: String):
Suppose I have a function defined like this: class Foo() { public: void bar(MyClass*
Suppose I have a function which looks like this: template <class In, class In2>
Suppose I have a free function called InitFoo . I'd like to protect this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.