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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:33:04+00:00 2026-05-23T11:33:04+00:00

Is there any way to write script in css and call or execute it

  • 0

Is there any way to write script in css and call or execute it whenever required ?

I need a <script> tag to be executed .

i need something like this..

css code

#execute{

<script> ..some script.. </script>

}

so whenever i use

<html>

.
.
.
.<div id="execute" />
.
.
.
.
</html>

so if i change the script changes will be reflected everywhere.

Is it possible?

EDIT:

Is it possible to keep my <script></script> tags inside some js file and i will host it. and then i will call some function() from my HTML so that the script will be executed everywhere i need it.

Can someone show me any example, tutorial how i can do it.
I don’t have much information about the Js file and how the function should be called.

Thank you all

  • 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-23T11:33:05+00:00Added an answer on May 23, 2026 at 11:33 am

    Does it have to be in CSS? jQuery is a great, simple way to do what you’re asking. You put all your style information in the CSS (what it’s intended for) and keep your javascript in the html or a .js file. Take a look at http://jquery.com. The code would look something like this

    $(function() {
        $('#execute')
            .someCoolFunction()
            .anotherCoolFunction();
    });
    

    You use $(function() { /* code */ }); to run the code when your document is ready, and you use $('#execute') to grab the element with the execute tag. You can then do a lot of cool javascript really easily with that jQuery element.

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

Sidebar

Related Questions

Is there any way to write a valid header/link/image? Something like <a href=index.html><h1 id=logo>Company
Is there any way to Write files to App_Data under medium trust hack? Im
Is there any way to write a Visual Studio Project file easy or do
Is there any way to write Shoes application using IDE (NetBeans for example)? I
Is there any way to write binary output to sys.stdout in Python 2.x? In
is there any way to write this foreach in linq or another better way,
Is there any way to write a MIDlet, but still use BlackBerry API classes
Calling all C macro gurus... Is there any way to write a C macro
Is there any other way to write javascript:false that is more pleasant? I'm building
Is there any standard way of implementing some sort of a write-through buffer for

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.