0

I want to do three things.

Stop it saying an embedded page says, so it's just a blank white box, give the f and t a link, and a class or ID so I can target them with CSS.

<!DOCTYPE html>
<html>
<body
<button 
onclick="myFunction()"><div 
class="containercross"><div 
class="cross1"><div 
class="cross2">
</div></div></div>
</a></button>
<script>
function myFunction() {
alert("f, t");
}</script><html><body>

The f should link Facebook, the t twitter and the cross just generate the pop up onclick

1 Answer 1

1

Regular alert() dialogs cannot be modified. There is text, and that's it.

You have to create your modal dialog with HTML and CSS.

There actually is a convenient <dialog> element now, but it only works in Chrome and variants.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok. Thanks....how would i structure a <dialog> pop up involving no JavaScript?
@New To be clear, you can use JavaScript, but you can't use only the alert() function. Once you have your <dialog> element on the page, you can do something like document.querySelector('dialog').showModal(). See also: developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.