Question

Javascript Provide the code to add the custom dropRank() method to the pokerCard object that changes...

Javascript

Provide the code to add the custom dropRank() method to the pokerCard object that changes the value of the rank property to "Queen". (Hint: Create the dropRank() function and use the this keyword to reference the current object.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Specification of question is not very clear

<!DOCTYPE html>
<html>
<body>
<script>
function dropRank(){

val=document.getElementById("jack").value; //get the value of current element
document.getElementById("jack").value="Queen" //now set it new value queen

}
</script>
<p>
<input type="text" id="jack" value="jack" readonly>
<button type="button" value="Jack" onclick="dropRank();"> Drop tank</button>
</p>
<!--on click call DropRank()-->


</body>
</html>

Add a comment
Know the answer?
Add Answer to:
Javascript Provide the code to add the custom dropRank() method to the pokerCard object that changes...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT