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 6568449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:28:44+00:00 2026-05-25T14:28:44+00:00

Which is preferred/right or when should you use one over the other and also

  • 0

Which is preferred/right or when should you use one over the other and also the benefits/downsides to using the following:

<a href="#" id="hypMyLink" onClick="myFunc();">a link</a>

<script>
    function myFunc(){
        //do something
    }
</script>

OR…

<a href="#" id="hypMyLink">a link</a>

<script>
    $(function() {
        $('#hypMyLink').click(function(e) {
            //do something
        });            
    });
</script>
    
  • 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-05-25T14:28:45+00:00Added an answer on May 25, 2026 at 2:28 pm

    In a perfect world of markup – all things being semantic you would seperate your markup, styling and javascript in their respective files.

    It just makes things so much easier to debug and in an industry where things change so often it makes it extremely simple if you know exactly what you are looking for be it events, styling or markup.

    As an example: moving to css files doing all the styling I have found that prethought is increased by segregating your elements that you require to select at a later time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which of these patterns should be preferred over the other and why? foreach(KeyValuePair<string, Dictionary<string,
Which method is preferred to just show 2 links vertically, one over another? in
I Want to know which one is preferred while coding to use Static Methods
Which one is better/faster/preferred 1: mov eax, 5 push eax mov eax, [someAddress] push
Is it preferred to have one depot with multiple folders which map to different
For the two string searching algorithms: KMP and suffix tree, which is preferred in
Which method is preferred for adding a row to a table? var tr =
Which is the preferred way of defining class properties in Python and why? Is
If I need to check multiple conditions, which is the preferred way with respect
I'm using sockets for communication between various processes right now. Everything is running on

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.