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

  • Home
  • SEARCH
  • 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 6206899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:32:00+00:00 2026-05-24T05:32:00+00:00

http://jsbin.com/uzogag/2/edit I’ve attempted and searched for jQuery code that will alert English from the

  • 0

http://jsbin.com/uzogag/2/edit

I’ve attempted and searched for jQuery code that will alert “English” from the attribute selector. It’s simple a newbie questions, but a good exercise. Would some kind soul lend wisdom?

JavaScript

$('p[language]').alert(this.text());

HTML

<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

</head>
<body>
  <h1>Select elements with specific text:</h1>
    <div>
    <p>This is paragraph 1.</p>
    <p language="English">This is paragraph 2.</p>
    <p>This is paragraph 3.</p>
    <p>This is paragraph 4.</p>
    </div>
  <form>
     <input type="button" value="Select" onclick="setStyle()"></input>
  </form>
</body>
</html>
  • 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-24T05:32:02+00:00Added an answer on May 24, 2026 at 5:32 am

    jQuery object’s do not have an alert method. Do this instead:

    alert($('p[language]').attr('language'));
    

    The selector p[language] will find the <p> element that has a language attribute.

    The attr method returns the value of the attribute, in this case, “English”. If the selector matched more than one element, this method will retrieve the value of the first match.

    The alert method is a global function (i.e. it’s a member of the window object).

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

Sidebar

Related Questions

http://jsbin.com/adojes/edit#preview my problem is to set the rounded-corners from jquery ui to the main
My code : http://jsbin.com/epuxu With help from SO, I managed to get addresses geocoded
Code as reference: http://jsbin.com/aboca3/2/edit In this example above (thank you SLaks) I am truncating
EDIT: See this in action here: http://jsbin.com/emobi/5 -- and that's using mouseenter/mouseleave. I have
Edit: I put this snippet of code in jsbin: http://jsbin.com/eneru I am trying to
code link: http://jsbin.com/ozoma3/edit codes (can copy/paste to a .html file, and run it) :
Please see see code http://jsbin.com/eveqe3/edit , also quoted below. I need to show text
Here's the link to my code: http://jsbin.com/edago3/edit I would love to find out what
Please see my code here http://jsbin.com/ijoxa3/edit var drawHorizondalLine = function(x1,y1,x2,y2, color) { var width
http://jsbin.com/uremuc/2/edit If I'm choosing jquery 1.5.2 in jsBin , running .attr('tagName') should return me

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.