How can we select an element's parameter using jQuery

id.ot

How can we update the <param name='wmode' value='WINDOW' to <param name='wmode' value='TRANSPARENT' using jQuery?

After multiple attempts I've ended up using the following, but the element is not selected:

$(window).load(function () {
    $("param[name='wmode'").attr('value', 'transparent')
});

Background:
The $(window).load(... function is necessary. I've tested this same snippet omitting [name='wmode'] and every param is overwritten to <param name="wmode" value="transparent"..., adding the [name='wmode'] breaks the selector somehow.

BenM

You have a typo in your selector. Update your code as follows:

$('param[name="wmode"]').prop('value', 'transparent');

Also, you might want to hook into the DOMReady function, not the window.load event. Use the following code:

$(function() {  
    $('param[name="wmode"]').prop('value', 'transparent');
});

Also, note the use of prop(), rather than attr(). Here's the jQuery documentation:

The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the .attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I select an element using JQuery and modify it's contents?

From Java

How can we select input element in div using this keyword

From Dev

how we can select checkbox using the keyboard

From Java

How can I select an element by name with jQuery?

From Dev

How can I select an element in jquery?

From Dev

How to select adjacent element using jquery?

From Dev

How to select own text of the element using jQuery

From Dev

how to populate a select element using jquery?

From Dev

How to select "this" element using JavaScript (not in jQuery)

From Dev

How to select particular element with class in jQuery using 'this'

From Dev

How to add and select an element in html using jquery

From Dev

How can we find count of element using selenium web driver

From Dev

How can I append two select element to table rows with using jQuery?

From Dev

How can I hide element using jQuery?

From Dev

how can i call element by using this in jquery

From Dev

using jquery steps ,how can we load last step directly

From Dev

How to select this element with jQuery?

From Dev

how can we pass html element as parameter in handlebar helper to achieve show more/less functionality

From Dev

How can I retrieve the text of a clicked element using jQuery's .text property?

From Dev

How can I dynamically apply the "left" px to a div's width, within the same parent element, using jQuery

From Dev

How can we extract particular elements value by using xpath when element value is different for each element

From Dev

How can I select the first specific class after element in jQuery

From Java

How can I select an element with multiple classes in jQuery?

From Dev

Jquery how can I select only the .clicked DOM Element

From Dev

How can I select an element from an jQuery object?

From Dev

Can we make a loaded page load a different page to an element in the first page using JQuery?

From Dev

Can we target a element which has (data-toggle="collapse") attribute and no class using jquery?

From Dev

How can we prevent parameter expansion?

From Dev

How can we prevent parameter expansion?

Related Related

  1. 1

    How can I select an element using JQuery and modify it's contents?

  2. 2

    How can we select input element in div using this keyword

  3. 3

    how we can select checkbox using the keyboard

  4. 4

    How can I select an element by name with jQuery?

  5. 5

    How can I select an element in jquery?

  6. 6

    How to select adjacent element using jquery?

  7. 7

    How to select own text of the element using jQuery

  8. 8

    how to populate a select element using jquery?

  9. 9

    How to select "this" element using JavaScript (not in jQuery)

  10. 10

    How to select particular element with class in jQuery using 'this'

  11. 11

    How to add and select an element in html using jquery

  12. 12

    How can we find count of element using selenium web driver

  13. 13

    How can I append two select element to table rows with using jQuery?

  14. 14

    How can I hide element using jQuery?

  15. 15

    how can i call element by using this in jquery

  16. 16

    using jquery steps ,how can we load last step directly

  17. 17

    How to select this element with jQuery?

  18. 18

    how can we pass html element as parameter in handlebar helper to achieve show more/less functionality

  19. 19

    How can I retrieve the text of a clicked element using jQuery's .text property?

  20. 20

    How can I dynamically apply the "left" px to a div's width, within the same parent element, using jQuery

  21. 21

    How can we extract particular elements value by using xpath when element value is different for each element

  22. 22

    How can I select the first specific class after element in jQuery

  23. 23

    How can I select an element with multiple classes in jQuery?

  24. 24

    Jquery how can I select only the .clicked DOM Element

  25. 25

    How can I select an element from an jQuery object?

  26. 26

    Can we make a loaded page load a different page to an element in the first page using JQuery?

  27. 27

    Can we target a element which has (data-toggle="collapse") attribute and no class using jquery?

  28. 28

    How can we prevent parameter expansion?

  29. 29

    How can we prevent parameter expansion?

HotTag

Archive