title: access HTML data attribute on an anchor with PrototypeJS 1.6
body: <p>I am having an issue with accessing an attribute of an anchor with PrototypeJS 1.6.0.3.</p>
  
  <p>My code below works when I hard-code the course_number variable, however I would like to be able to extract it from the anchor.</p>
  
  <p>This is my anchor tag:</p>
  
  <pre><code>&lt;a class="course_number_info_link" data-course-number="{$foo}" href="#"&gt;{$foo}&lt;/a&gt;
  </code></pre>
  
  <p>This is my invoke method observing a click on the anchor:</p>
  
  <pre><code>$$('.course_number_info_link').invoke('observe', 'click', this.getCourseInfo(this));
  </code></pre>
  
  <p>This is my <code>getCourseInfo</code> method, however the <code>course_number</code> doesn't pull through. How can I get access to the data attribute?</p>
  
  <pre><code>    getCourseInfo: function(element) {
  
         var course_number = element.readAttribute('data-course-number');
  
         console.log(course_number);
  
         new Ajax.Updater('result-' + course_number, '/ajax/get_course_info.php', {
                  parameters: { course_no: course_number },
                  onSuccess: function(response) {
                      console.log(response);
                  }
         });
  
      }    
  </code></pre>